org.openbp.jaspira.gui.interaction
Interface InteractionClient

All Known Subinterfaces:
ProcessElementContainer, VisualElement
All Known Implementing Classes:
AbstractTagFigure, DecisionNodeFigure, FinalNodeFigure, FlowConnection, ForkNodeFigure, HLineFigure, HorizontalRotatingTagFigure, InitialNodeFigure, JaspiraPageContainer, JoinNodeFigure, LineFigure, MergeNodeFigure, MultiSocketNodeFigure, NodeFigure, ParamConnection, ParamFigure, PlaceholderNodeFigure, PluginDivider, PluginPanel, PolySplineConnection, PrimitiveNodeFigure, ProcessDrawing, ProcessVariableConnection, ProcessVariableFigure, SimpleTextTagFigure, SocketFigure, SocketToolBoxPlugin, StandardToolBoxPlugin, StraightTagFigure, TabbedPluginContainer, TextElementFigure, ToolBoxPlugin, UserToolBoxPlugin, VariablesPlugin, VLineFigure, WaitStateNodeFigure, WorkflowEndNodeFigure, WorkflowNodeFigure

public interface InteractionClient

A drop client is an item that may receive drag and drop events. Each client defines drop regions that may accept drops.

Author:
Stephan Moritz

Method Summary
 void dragActionTriggered(java.lang.Object regionId, java.awt.Point p)
          Called to signal additional actions, such as hovering for a certain time over the region.
 void dragEnded(java.awt.datatransfer.Transferable transferable)
          called when a dragging has ended.
 void dragStarted(java.awt.datatransfer.Transferable transferable)
          Called when a dragging has been started.
 java.util.List getAllDropRegions(java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          Returns a list of all regions of this client AND possible sub clients.
 java.util.List getAllImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client or one of its sub clients.
 java.util.List getDropRegions(java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          Returns a list of drop regions of this client that are compatible with the provided data flavors.
 java.util.List getImportersAt(java.awt.Point p)
          Returns all importers which will be accepted at the given point by this client.
 java.util.List getSubClients()
          Returns subordinate clients of this client.
 boolean importData(java.lang.Object regionId, java.awt.datatransfer.Transferable data, java.awt.Point p)
          Imports the given transferable into the given region.
 

Method Detail

getSubClients

java.util.List getSubClients()
Returns subordinate clients of this client.

Returns:
A list of InteractionClient objects or null if this drop client doesn't have sub drop clients

getDropRegions

java.util.List getDropRegions(java.util.List flavors,
                              java.awt.datatransfer.Transferable data,
                              java.awt.event.MouseEvent mouseEvent)
Returns a list of drop regions of this client that are compatible with the provided data flavors.

Parameters:
flavors - List of data flavors to check
data - Transferable to be imported
mouseEvent - Mouse event that initiated the drag action
Returns:
A list of DragAwareRegion object or null if the drop client cannot satisfy at least one of the supplied data flavors.
The list will contain only regions that belong directly to this drop client.

getAllDropRegions

java.util.List getAllDropRegions(java.util.List flavors,
                                 java.awt.datatransfer.Transferable data,
                                 java.awt.event.MouseEvent mouseEvent)
Returns a list of all regions of this client AND possible sub clients.

Parameters:
flavors - List of data flavors to check
data - Transferable to import
mouseEvent - Mouse event that initiated the drag action
Returns:
A list of DragAwareRegion object or null if the drop client or one of its sub clients cannot satisfy at least one of the supplied data flavors

importData

boolean importData(java.lang.Object regionId,
                   java.awt.datatransfer.Transferable data,
                   java.awt.Point p)
Imports the given transferable into the given region.

Parameters:
regionId - Id of the region to import into (see BasicDropRegion.getId)
data - Transferable to import
p - Drop point in glass coordinates
Returns:
true The data was successfully imported.
false An error occured while importing the data.

dragStarted

void dragStarted(java.awt.datatransfer.Transferable transferable)
Called when a dragging has been started.

Parameters:
transferable - Transferable to be dragged

dragEnded

void dragEnded(java.awt.datatransfer.Transferable transferable)
called when a dragging has ended.

Parameters:
transferable - Transferable that has been dragged

dragActionTriggered

void dragActionTriggered(java.lang.Object regionId,
                         java.awt.Point p)
Called to signal additional actions, such as hovering for a certain time over the region.

Parameters:
regionId - Id of the region to import into (see BasicDropRegion.getId)
p - Current mouse position in screen coordinates

getImportersAt

java.util.List getImportersAt(java.awt.Point p)
Returns all importers which will be accepted at the given point by this client.

Parameters:
p - Current mouse position in screen coordinates
Returns:
A list of Importer objects or null

getAllImportersAt

java.util.List getAllImportersAt(java.awt.Point p)
Returns all importers which will be accepted at the given point by this client or one of its sub clients.

Parameters:
p - Current mouse position in screen coordinates
Returns:
A list of Importer objects or null


Copyright © 2011. All Rights Reserved.