Teaching:TUW - UE InfoVis WS 2007/08 - Gruppe 01 - Aufgabe 1 - Drag and Drop: Difference between revisions

From InfoVis:Wiki
Jump to navigation Jump to search
(New page: ==Overview of User Interaction== A drag and drop transaction consists of the following actions: 1. A user presses and holds BTransfer, usually mouse button 2, over a source object sta...)
 
No edit summary
Line 1: Line 1:
[Motif Programmer's Guide] Motif Programmer's Guide, 1994-1996, The Santa Cruz Operation, http://www.s-and-b.ru/syshlp/motif_guide/MotifProgGuide/TOC.html
==Overview of User Interaction==
==Overview of User Interaction==



Revision as of 17:23, 3 November 2007

[Motif Programmer's Guide] Motif Programmer's Guide, 1994-1996, The Santa Cruz Operation, http://www.s-and-b.ru/syshlp/motif_guide/MotifProgGuide/TOC.html


Overview of User Interaction

A drag and drop transaction consists of the following actions:

  1. A user presses and holds BTransfer, usually mouse button 2, over a source object starting a drag transaction. The application owning that object is the initiator of the drag. The current pointer is replaced by a drag icon-a picture representing the item being dragged.
  2. The user moves the pointer. From now until a drop occurs, the drag icon replaces the mouse pointer.
  3. The user drops the object, usually by releasing the mouse button. 

Locations on the screen that can accept drops are drop sites, and the application owning that drop site is the destination or receiver.

The drag icon can be dropped anywhere on the screen. However, only certain widgets have registered themselves as drop sites and are able to process the drop.

The receiver application usually performs some action on the information represented by the dragged icon. The initiator application may also perform some action based on the results of a drag transaction.

A drop can be between applications or within the same application. An application can be both source and destination of a drop, source only, destination only, or not participate in drag and drop at all.

The user can request help about a drop site, if available, by dragging to the drop site, and pressing KHelp (usually F1).

The user can cancel the drag at any time by pressing KCancel, usually Escape.

Overview of Drag-Over Effects

The drag icon consists of three parts:

   * The source icon is a picture representing the type of the source object, such as text.
   * The state icon can be used to show whether or not the object being dragged can be dropped at its current location on the screen.
   * The operation icon can be used to show what action should happen when the drop takes place. 

In the following illustration, the running figure is the source icon, the arrow in the upper left is the state icon, and the rectangles with the corner folded over indicate a Copy is desired.

Icon
Icon

These parts can be combined (blended) and attached to each other in different ways. The default blending and attachment are shown in the previous illustration.

Parts of the drag icon may change shape or color as it is being dragged through potential drop sites, providing visual feedback about possible drop sites to the user. These changes are drag-over effects.

Applications can use the default drag icon effects, or provide more sophisticated or custom drag icons. The application or user can customize these drag-over effects in resource files.

Drag States

During a drag, there are three states that describe the relationship of a drag icon to what is under it at the time:

Valid drop site

   The drag icon is over a drop site on which it can potentially be dropped (this is only a hint; when the drop is actually attempted, further processing may show that the drop cannot actually be done). 

Invalid drop site

   The drag icon is over a drop site, but it cannot be dropped there. 

No drop site

   The drag icon is not over a registered drop site. 

The default state icon for all three states is the same: an arrow in the upper left corner of the drag icon. Because the icon is the same for all three states, it appears not to change during the drag. The application or the user can provide custom state icons or colors in a resource file.

Drag Operations

The user specifies what action is to take place when the drop occurs by pressing certain keys when the drag starts or while the drag is in process:

Shift only

   Force a move from the initiator to the receiver client (Move) 

Ctrl only

   Force a copy from the initiator to the receiver client (Copy) 

Shift and Ctrl

   Force a link between the initiator and receiver clients (Link) 

The operation chosen by the user must be valid for both the drag source and the drop site, or the drop site will be considered invalid.

If the user does not specify an operation, one is chosen by the toolkit. It choses an operation that is valid for both the drag source and drop site. Move is the first choice, Copy is the second, and Link is the third. If the system cannot find a valid operation, the drop site is considered invalid.

The operation icon reflects the operation chosen by the user or by the system. If the operation is changed by the user during the drag, the operation icon changes also.

The operation icon may change as the drag icon moves to different drop sites if the drop sites accept different operations.

Overview of Drag-Under Effects

A widget registered as a drop site may change visually as a drag icon passes over it. These visual cues are drag-under effects. The sensitive area of the widget is the part that responds to drag and drop. By default it is the whole widget, but applications can specify that only parts of the widget respond to drag and drop.

Various highlighting styles are possible:

   * A border around the sensitive area of the drop site widget. This is the default value.
   * The sensitive area of the drop site widget looks pushed out.
   * The sensitive area of the drop site widget looks pushed in.
   * A special pixmap is displayed within the sensitive area of the drop site widget, overwriting what is normally there.
   * No drag-under effects are used for the drop site widget. 

Applications can use the default drag-under visual effects, or create more sophisticated or custom effects, such as special animation or sound effects.

Overview of Drop Effects

Visual effects also take place during the drop:

   * The drag icon appears to sit over the drop site while the processing for the drop is finishing, but the standard cursor is restored and can be used normally.
   * The source icon appears to melt into the drop site if the drop is successful.
   * The source icon appears to snap back to the source if the drop is unsuccessful.
   * A dialog window containing information about a drop site should appear if the user has requested help and the receiver client provides help, otherwise nothing happens.
   * The source icon appears to snap back to the source and the previous X cursor returns if Cancel is requested. All drag-under and drag-over effects are removed. 

These drop effects cannot be changed by the application or the user.