Reviews : Java Books : 3D User Interfaces with Java 3D :


Title: 3D User Interfaces with Java 3D
ISBN: 1884777902
US Price: $49.95
© Manning Publications Co.

8.3.3 Snap drag

If the idea of programmatically moving the mouse cursor is distasteful, even for a little stutter, then snap drag is a possible alternative to sticky drag. In snap drag, when the dragged object is released, it jumps or snaps to the nearest valid position, such as a mutual alignment with a neighboring object, a predefined graduation detent, or a snap point on another object. In other words, we've traded cursor jumping for object jumping. In both cases what is important to PTF is the discontinuity, which is what hopefully conveys a tactile feeling to the user. As with the other PTF drags, sound effects can significantly reinforce the tactile effect.

A drawback of snap drag is that its tactile effect is weaker than in sticky drag because there is no feedback during the operation, only after the drag is done. Another problem is that the dynamic discontinuity can be startling and at times unappreciated, perhaps even more so than with sticky drag. In sticky drag, the stutter occurs while the drag is underway. Once the user releases the mouse button, however, the object stays where the user left it. In snap drag, the snap occurs when the drag is done, just when the user thinks everything is positioned just right. An idea that might come to mind is to perform the snap during the drag rather than after it. This solution is probably worse than the problem because the target object tends to jump and squirm around while the user is trying to drag it into position.

As with sticky drag, the user can have problems performing fine adjustments near a snap position. These problems can be mitigated by using a modifier key to block the snap or through subsequent adjustment with the arrow keys.

8.3.4 Solid drag

One aspect of drags that must be resolved is what to do when two objects collide. One extreme is for the objects to act like ghosts and simply pass through one another. The other extreme is for the target object to stop dead in its tracks, as would an object in the real world. This latter approach, where the objects involved act like solids, is called solid drag. In some sense, a solid drag is like a sticky drag with infinite stick when a collision occurs. Overlapping objects can confuse users because they are inconsistent with real-world experiences, so solid drag should be highly desirable. Unfortunately, it has some undesirable side effects.

Solid drag prevents objects from passing through one another. This means that to move an object from one place to another in the scene, the user must maneuver it around any obstructions. For example, in an office layout application, to move a desk from one office to an adjacent one, the user may have to walk the desk down the hall, around the corner, and up a parallel hallway. What if the door opening is too narrow to slide the desk through? Does this mean the user has to tip the desk on its side and remove the legs, as might have to be done in the real world? Obviously the need for intuitive simulated reality has to be balanced with the need for user effectiveness. User-interface metaphors can give you enough rope to hang yourself, which is why some designers eschew their use. As with the other drags, modifier and arrow keys can be used as a means to escape from such predicaments.

8.3.5 Strong grip

Drag grip describes the kind of dynamics that occur during a drag when the target object encounters another object or an alignment point. A strong grip is analogous to the user having a firm grasp on the target object. As in the real world, if the object is firmly held, it is prevented from changing its orientation when slid and another object is bumped. It is also prevented from changing its center of rotation when turned and a corner catches on another object. This may sound a lot like solid drag, but here the focus is only on that aspect of the operation that keeps the target from wiggling around under the cursor. Strong grip is by far the most common form of drag grip because it requires that the programmer do nothing. In the virtual world, objects have to be programmed in order for them to react to one another.

8.3.6 Weak grip

Unlike a strong grip, a weak grip gives the target object a bit of freedom to slide around under the drag point or to rotate about it if the target encounters another object or an alignment point. As the name implies, this is analogous to the user having a weak grip on the object as the user drags it around in the scene. For example, if while sliding a desk in a room and a corner hits a wall, the desk might start to rotate. If the user continues to drag the object, it might eventually rotate so it becomes flush with the wall. Similarly, if while rotating a desk a corner hits a wall, then the desk might start to slide away from the wall to allow the desk to turn.

Whenever multi-object dynamics are involved, questions arise as to which objects remain stationary and which objects react, especially if chain reactions can potentially occur. A full-blown distributed dynamics simulation is probably overkill. Usually, letting only the dragged object move is a good idea because it is already moving and any additional movement of it as a result of a weak grip effect would not be unexpected to the user.

How to Add Java Applets to Your Site

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.