org.openbp.jaspira.gui.interaction
Class DropClientUtil

java.lang.Object
  extended by org.openbp.jaspira.gui.interaction.DropClientUtil

public class DropClientUtil
extends java.lang.Object

Utility methods for usage by drop clients.

Author:
Heiko Erhardt

Method Summary
static void dragEnded(InteractionClient client, java.awt.datatransfer.Transferable transferable)
          called when a dragging has ended.
static void dragStarted(InteractionClient client, java.awt.datatransfer.Transferable transferable)
          Called when a dragging has been started.
static java.util.List getAllDropRegions(InteractionClient client, java.util.List flavors, java.awt.datatransfer.Transferable data, java.awt.event.MouseEvent mouseEvent)
          Returns a list of all regions of the given client AND possible sub clients.
static java.util.List getAllImportersAt(InteractionClient client, java.awt.Point p)
          Returns all importers which will be accepted at the given point by the given client or one of its sub clients.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllDropRegions

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

Parameters:
client - Drop client
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

getAllImportersAt

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

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

dragStarted

public static void dragStarted(InteractionClient client,
                               java.awt.datatransfer.Transferable transferable)
Called when a dragging has been started.

Parameters:
client - Drop client
transferable - Transferable to be dragged

dragEnded

public static void dragEnded(InteractionClient client,
                             java.awt.datatransfer.Transferable transferable)
called when a dragging has ended.

Parameters:
client - Drop client
transferable - Transferable that has been dragged


Copyright © 2011. All Rights Reserved.