com.imagero.gui.flowin
Class FloatingWindowDragHandler

java.lang.Object
  extended byjavax.swing.event.MouseInputAdapter
      extended bycom.imagero.gui.flowin.FloatingWindowDragHandler
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.MouseInputListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
Direct Known Subclasses:
ToolBarDragHandler

public class FloatingWindowDragHandler
extends javax.swing.event.MouseInputAdapter

FloatingWindowDragHandler.
Mouse handler for FloatingWindow.


Field Summary
static int DRAG_OVER_DELAY
          if docking condition is true then window is docked after specified delay
static int DRAG_OVER_DOCK
          immediately docking - not supported (!)
static int DRAG_OVER_SHOW_ARMED
          if docking condition is true then just "armed" state is shown
 
Constructor Summary
FloatingWindowDragHandler(FloatingWindow floatingWindow)
          create new FloatingWindowDragHandler for FloatingWindow
 
Method Summary
protected  boolean canDock()
          check if FloatingWindow can be docked (e.g. bounding rectangle of FloatingWindow's window intersects with bounding rectangle of one of anchors)
protected  void createTimer()
          create timer for delayed docking of FloatingWindow
 void dockWindow(java.awt.Container anchor, java.lang.Object constraints)
           
 int getDockDelay()
           
protected  int getState()
          get current state of FloatingWindow
Simple example showing how to determine if FloatingWindow is in docked state now:
if((getState() & FloatingWindow.DOCKED) == FloatingWindow.DOCKED) { //take appropriate action }
 void mouseDragged(java.awt.event.MouseEvent e)
          Invoked when a mouse button is pressed on a component and then dragged.
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released on a component.
 void setDockDelay(int dockDelay)
           
 
Methods inherited from class javax.swing.event.MouseInputAdapter
mouseClicked, mouseEntered, mouseExited, mouseMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DRAG_OVER_DELAY

public static final int DRAG_OVER_DELAY
if docking condition is true then window is docked after specified delay

See Also:
Constant Field Values

DRAG_OVER_DOCK

public static final int DRAG_OVER_DOCK
immediately docking - not supported (!)

See Also:
Constant Field Values

DRAG_OVER_SHOW_ARMED

public static final int DRAG_OVER_SHOW_ARMED
if docking condition is true then just "armed" state is shown

See Also:
Constant Field Values
Constructor Detail

FloatingWindowDragHandler

public FloatingWindowDragHandler(FloatingWindow floatingWindow)
create new FloatingWindowDragHandler for FloatingWindow

Parameters:
floatingWindow - FloatingWindow
Method Detail

canDock

protected boolean canDock()
check if FloatingWindow can be docked (e.g. bounding rectangle of FloatingWindow's window intersects with bounding rectangle of one of anchors)

Returns:
true if FloatingWindow can be docked

createTimer

protected void createTimer()
create timer for delayed docking of FloatingWindow


dockWindow

public void dockWindow(java.awt.Container anchor,
                       java.lang.Object constraints)

getDockDelay

public int getDockDelay()

getState

protected int getState()
get current state of FloatingWindow
Simple example showing how to determine if FloatingWindow is in docked state now:
 if((getState() & FloatingWindow.DOCKED) == FloatingWindow.DOCKED) {
      //take appropriate action
 }
 

Returns:
current state of FloatingWindow
See Also:
FloatingWindow.DOCKED, FloatingWindow.FREE, FloatingWindow.INTERN, FloatingWindow.DRAGGING, FloatingWindow.INVISIBLE

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseMotionListener
Invoked when a mouse button is pressed on a component and then dragged. MOUSE_DRAGGED events will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

Due to platform-dependent Drag&Drop implementations, MOUSE_DRAGGED events may not be delivered during a native Drag&Drop operation.


mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
Invoked when a mouse button has been pressed on a component.


mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
Invoked when a mouse button has been released on a component.


setDockDelay

public void setDockDelay(int dockDelay)