Package org.graffiti.plugin.view.interactive

Contains interfaces and classes for views supporting the trigger/action paradigm.

See:
          Description

Interface Summary
GestureFeedbackProvider Provides feedback for UserGestures raised by InteractiveView s.
InSlotMap Classes implementing InSlotMap allow to query the values associated with Slots.
InteractiveView<T extends InteractiveView<T>> Views implementing InteractiveView support the trigger/action paradigm.
MouseCursorProvider GestureFeedbackProviders implementing MouseCursorProvider support setting the bitmap representation of the mouse cursor.
Observer<T> Classes implementing Observer can be attached to an Observable in order to be notified of changes of the observed property.
OutSlotMap Classes implementing OutSlotMap allow to assign values to Slots.
PopupMenuCompatibleProvider GestureFeedbackProviders implementing PopupMenuCompatibleProvider support showing a popup menu.
SlotEditableEnum Enumerations implementing SlotEditableEnum are supported by the tool system to be used as the type of parameter slots.
TranslationProvider GestureFeedbackProviders implementing TranslationProvider support the retrieval of localized strings.
UserGesture Classes implementing UserGesture represent basic user actions such as mouse movements, keystrokes, selecting an entry in a context menu or doing nothing for a defined period of time.
UserGestureListener Classes implementing UserGestureListener are interested in the occurrence of user gestures.
 

Class Summary
GraphElementFinder Subclasses of GraphElementFinder provide methods for detecting GraphElements that lay on the top at a specific position or intersect a specific rectangle.
KeyboardGesture User gesture that represents a key press or release.
KeyPressGesture User gesture that represents a key press.
KeyReleaseGesture User gesture that represents a key release.
ModifiableUserGesture Represents a user gesture that is aware of the state of the modal keys and mouse buttons.
MouseButtonGesture User gesture that involves a mouse button.
MouseDragGesture User gesture that represents dragging the mouse, e.g.
MouseGesture User gesture involving the mouse.
MouseMoveGesture User gesture that represents moving the mouse while none of the mouse buttons is being pressed.
MousePressGesture User gesture that represents pressing a mouse button.
MouseReleaseGesture User gesture that represents releasing a mouse button.
Observable<T> Class that encapsulates a property and manages a list of Observers, which will be informed when that property changes.
PopupMenuItem Represents an item in a popup menu that is shown by PopupMenuCompatibleProvider.
PopupMenuSelectionGesture UserGesture representing the selection of an item in or the cancellation of a popup menu.
Slot<T> Slots are typed containers that hold the values supplied by triggers and used by triggers and actions as parameters.
SlotEditorComponentBuilder<T> Common base class of objects that create components for Observables in order to graphically edit the value of a parameter slot.
SlotMap A container, which manages the association of Slots with values.
ToolAction<T extends InteractiveView<?>> Subclasses of ToolAction represent basic operations on the graph, the attribute system and the view.
ToolActivationGesture4  
Trigger Base class of all triggers, which help to interpret user gestures.
UserGestureDispatcher A UserGestureDispatcher receives UserGestures and broadcasts them to interested listeners.
ViewFamily<T extends InteractiveView<T>> If different view classes want to share the same tools, triggers and actions, they return the same ViewFamily instance.
WaitGesture UserGesture representing doing nothing for a defined period of time.
 

Enum Summary
MouseButton Enumeration of mouse buttons, which, when used by triggers as a parameter type, is prepared to be used for the graphical configuration of tools.
 

Exception Summary
SlotAssignmentException RuntimeException that is thrown to indicate that a value and a slot are not compatible.
 

Annotation Types Summary
ActionId ActionId is annotated to tool actions in order to declare their id.
InSlot InSlot is annotated to slots to indicate that they are used as input slots.
OutSlot OutSlot is annotated to slots to indicate that they are used as output slots.
ParamSlot ParamSlot is annotated to slots to indicate that they are used as trigger parameters.
 

Package org.graffiti.plugin.view.interactive Description

Contains interfaces and classes for views supporting the trigger/action paradigm. This concept is explained in the following sections.

Overview of the trigger/action paradigm

This section explains the new concept of interaction between the user and the editor for viewing and manipulating graphs.

Views

Views present the graph to the user in a graphical manner. Classes that represent a view implement InteractiveView. They should not directly implement the obsolete View interface, as it is left unchanged for compatibility reasons only. Views own a JComponent as their display. When the user interacts with the component, the view does not respond directly but rather passes a new usergesture to its assigned dispatcher.

User gestures

User gestures represent basic user actions such as mouse movements, keystrokes, selecting an entry in a context menu or doing nothing for a defined period of time. When a view detects an user action, it creates a new object implementing UserGesture and passes it to its assigned dispatcher. The view is free in its decision of which object to create for a particular user action, and must not make any assumption about how the program should react. This package provides classes such as MouseGesture or KeyboardGesture for convenience, but their use is not prescribed.

Triggers

As the kind of generated user gestures is closely related to the originating view and may include data from new kinds of input devices that were unknown at the time the tool system was created, each view class provides a hierarchy of triggers that help to interpret user gestures. Every trigger (besides the root trigger, which matches all user gestures) has a an associated parent trigger and matches a subset of the user gestures matched by its parent. The child-parent association is used instead of inheritance in order to avoid the Call-super antipattern. When a trigger or one of its children is used in the currently active tool and matches a user gesture, it fills its slots with related data.

Actions

Actions represent basic operations on the graph, the attribute system and the view. In addition to the actions that are always available, such as creating a new node, every view class provides a list of view-specific actions like zooming or drawing a selection rectangle. Each action has a list of parameter slots, which must be filled with values before the action is executed. All actions inherit from ToolAction.

Slots

Slots are typed containers that hold the values supplied by triggers and used by triggers and actions as parameters. Objects of the Slot class do not directly hold the values but rather describe the type, name, default values etc. of the slots. The association of slots with values is maintained by SlotMap.

Tools

Tools define a mode of interaction by relating triggers to actions. The tool system is currently implemented by the FastTool-plugin.

Example

The following example illustrates the introduced concepts: Suppose that there is a view for showing the graph in a 2D visualization. This view defines a trigger MousePressTrigger, which matches mouse press gestures and has a parent MouseTrigger, which matches any mouse gestures. The currently active tool consists of a MousePressTrigger, whose output slot is connected with the input slot of a supposed CreateNodeAction. When the user clicks on the component of the view, it passes a new MousePressGesture to its dispatcher. As the current tool contains MousePressTrigger, its parent MouseTrigger matches that user gesture and fills its outgoing position slot with the position of the mouse cursor. Then MousePressTrigger fires, the mouse position is transmitted to the input slot of CreateNodeAction and that action is activated, creating a new node at said position.


Diagram 1: Class diagram of the example scenario.


Diagram 2: Object diagram of the example scenario.

GestureFeedbackProvider

For some of the user's actions one wants to provide a feedback more directly than via the model, i.e. the graph or the attribute system. For instance, when the user tries to select a group of graph elements, it is useful to show a selection rectangle during the selection process. As some feedbacks are common to many kinds of views, the InteractiveView interface contains the method InteractiveView.getGestureFeedbackProvider(). If views from different classes return feedback providers implementing the same subinterface of GestureFeedbackProvider, they can share the same ToolAction class activating that feedback. For example, every view that returns a feedback provider implementing PopupMenuCompatibleProvider, can utilize the org.graffiti.plugins.modes.fast.actions.ShowPopupMenu action.



Generated at 2012-05-30 11:00:36 PM CEST