org.openbp.jaspira.gui.interaction
Class BasicDragReactor

java.lang.Object
  extended by org.openbp.jaspira.gui.interaction.BasicDropRegion
      extended by org.openbp.jaspira.gui.interaction.BasicDragReactor
All Implemented Interfaces:
DragAwareRegion

public class BasicDragReactor
extends BasicDropRegion

A drop region that delays drag enter events to the drop client. This prevents flickering of e. g. plugin containers while a plugin is dragged over it. The delay time can be specified in the constructor. After timer expiration, the InteractionClient.dragActionTriggered(java.lang.Object, java.awt.Point) method of the parent of this drop region is called.

Author:
Stephan Moritz

Field Summary
 
Fields inherited from class org.openbp.jaspira.gui.interaction.BasicDropRegion
id, origin, parent, toolTipText
 
Fields inherited from interface org.openbp.jaspira.gui.interaction.DragAwareRegion
COPY, COPY_OR_MOVE, MOVE, NONE
 
Constructor Summary
BasicDragReactor(java.lang.Object id, InteractionClient parent, java.awt.Component source, long delay)
          Constructor.
BasicDragReactor(java.lang.Object id, InteractionClient parent, java.awt.geom.RectangularShape shape, java.awt.Component origin, long delay)
          Constructor.
 
Method Summary
 boolean canImport()
          BasicDropRegion objects can always import.
 boolean dragEnter()
          The mouse enters the drop region while in a dragging action.
 boolean dragExit()
          The mouse exits the drop region while in a dragging action.
 boolean importData(java.awt.datatransfer.Transferable data, java.awt.Point p)
          Import will be performed by the parent itself, so we do nothing here
 
Methods inherited from class org.openbp.jaspira.gui.interaction.BasicDropRegion
draw, getBounds, getCursor, getFrameColor, getId, getOrigin, getOverlay, getPaint, getParent, getShape, getStroke, getToolTipText, reactsOn, setCursor, setFrameColor, setId, setOrigin, setOverlay, setPaint, setParent, setShape, setStroke, setToolTipText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicDragReactor

public BasicDragReactor(java.lang.Object id,
                        InteractionClient parent,
                        java.awt.geom.RectangularShape shape,
                        java.awt.Component origin,
                        long delay)
Constructor.

Parameters:
delay - Delay in milliseconds

BasicDragReactor

public BasicDragReactor(java.lang.Object id,
                        InteractionClient parent,
                        java.awt.Component source,
                        long delay)
Constructor.

Parameters:
delay - Delay in milliseconds
Method Detail

canImport

public boolean canImport()
Description copied from class: BasicDropRegion
BasicDropRegion objects can always import.

Specified by:
canImport in interface DragAwareRegion
Overrides:
canImport in class BasicDropRegion

dragEnter

public boolean dragEnter()
The mouse enters the drop region while in a dragging action. Starts the timer.

Specified by:
dragEnter in interface DragAwareRegion
Overrides:
dragEnter in class BasicDropRegion
Returns:
Always true

dragExit

public boolean dragExit()
The mouse exits the drop region while in a dragging action. Stops the delay timer

Specified by:
dragExit in interface DragAwareRegion
Overrides:
dragExit in class BasicDropRegion
Returns:
Always true

importData

public boolean importData(java.awt.datatransfer.Transferable data,
                          java.awt.Point p)
Import will be performed by the parent itself, so we do nothing here

Specified by:
importData in interface DragAwareRegion
Overrides:
importData in class BasicDropRegion
Parameters:
data - Data to import
p - Current mouse position
Returns:
Always false


Copyright © 2011. All Rights Reserved.