bibliothek.gui.dock.control
Class DefaultDockRelocator.DefaultRemoteRelocator

java.lang.Object
  extended by bibliothek.gui.dock.control.DefaultDockRelocator.DefaultRemoteRelocator
All Implemented Interfaces:
DirectRemoteRelocator, RemoteRelocator
Enclosing class:
DefaultDockRelocator

private class DefaultDockRelocator.DefaultRemoteRelocator
extends java.lang.Object
implements RemoteRelocator, DirectRemoteRelocator

An implementation connecting a RemoteRelocator to the enclosing DefaultDockRelocator.

Author:
Benjamin Sigg

Nested Class Summary
 
Nested classes/interfaces inherited from interface bibliothek.gui.dock.control.RemoteRelocator
RemoteRelocator.Reaction
 
Field Summary
private  Dockable dockable
          the Dockable which might be moved by this relocator
 
Constructor Summary
DefaultDockRelocator.DefaultRemoteRelocator(Dockable dockable)
          Creates a new remote
 
Method Summary
 void cancel()
          Cancels the current drag & drop operation.
 void drag(int x, int y, boolean always)
          Gives a feedback to the user, that a Dockable is moved around.
Prepares for a drop-event.
 RemoteRelocator.Reaction drag(int x, int y, int modifiers)
          This method works on the drag-part of a drag & drop operation.
 void drop(int x, int y)
          Stops a dnd-operation either by dropping the Dockable (if possible) or by canceling the operation.
 RemoteRelocator.Reaction drop(int x, int y, int modifiers)
          This method works on the drop-part of a drag & drop operation.
 void init(int x, int y, int dx, int dy)
          This method starts a drag & drop operation.
 RemoteRelocator.Reaction init(int x, int y, int dx, int dy, int modifiers)
          This method starts or cancels a drag & drop operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dockable

private Dockable dockable
the Dockable which might be moved by this relocator

Constructor Detail

DefaultDockRelocator.DefaultRemoteRelocator

public DefaultDockRelocator.DefaultRemoteRelocator(Dockable dockable)
Creates a new remote

Parameters:
dockable - the dockable which might be moved
Method Detail

cancel

public void cancel()
Description copied from interface: DirectRemoteRelocator
Cancels the current drag & drop operation.

Specified by:
cancel in interface DirectRemoteRelocator
Specified by:
cancel in interface RemoteRelocator

drag

public void drag(int x,
                 int y,
                 boolean always)
Description copied from interface: DirectRemoteRelocator
Gives a feedback to the user, that a Dockable is moved around.
Prepares for a drop-event.

Specified by:
drag in interface DirectRemoteRelocator
Parameters:
x - the x-coordinate on the screen, where the (simulated) event occurred
y - the y-coordinate on the screen, where the (simulated) event occurred
always - true if a call to this method should always result in a drag-event, false if the restrictions of the DockRelocator should be respected. A restriction might be, that the location of the mouse must have a minimal distance to the initial location of the mouse.
See Also:
DockRelocator.getDragDistance()

drag

public RemoteRelocator.Reaction drag(int x,
                                     int y,
                                     int modifiers)
Description copied from interface: RemoteRelocator
This method works on the drag-part of a drag & drop operation. This method simulates a mouse-dragged event.

Specified by:
drag in interface RemoteRelocator
Parameters:
x - the x-coordinate on the screen, where the (simulated) event occurred
y - the y-coordinate on the screen, where the (simulated) event occurred
modifiers - the state of the mouse, see InputEvent.getModifiersEx().
Returns:
how this remote reacts on the call, see RemoteRelocator.Reaction

drop

public void drop(int x,
                 int y)
Description copied from interface: DirectRemoteRelocator
Stops a dnd-operation either by dropping the Dockable (if possible) or by canceling the operation.

Specified by:
drop in interface DirectRemoteRelocator
Parameters:
x - the x-coordinate on the screen, where the (simulated) event occurred
y - the y-coordinate on the screen, where the (simulated) event occurred

drop

public RemoteRelocator.Reaction drop(int x,
                                     int y,
                                     int modifiers)
Description copied from interface: RemoteRelocator
This method works on the drop-part of a drag & drop operation. This method simulates a mouse-released event.
The drag & drop operation may not be finished after an invocation of this method, clients should carefully analyze the resulting RemoteRelocator.Reaction

Specified by:
drop in interface RemoteRelocator
Parameters:
x - the x-coordinate on the screen, where the (simulated) event occurred
y - the y-coordinate on the screen, where the (simulated) event occurred
modifiers - the state of the mouse, see InputEvent.getModifiersEx().
Returns:
how this remote reacts on the call, see RemoteRelocator.Reaction

init

public void init(int x,
                 int y,
                 int dx,
                 int dy)
Description copied from interface: DirectRemoteRelocator
This method starts a drag & drop operation. This method simulates a mouse-pressed event.

Specified by:
init in interface DirectRemoteRelocator
Parameters:
x - the x-coordinate on the screen, where the (simulated) event occurred
y - the y-coordinate on the screen, where the (simulated) event occurred
dx - the x-coordinate of the mouse on the simulated Component which sent the event, 0 is a good default-value.
dy - the y-coordinate of the mouse on the simulated Component which sent the event, 0 is a good default-value.

init

public RemoteRelocator.Reaction init(int x,
                                     int y,
                                     int dx,
                                     int dy,
                                     int modifiers)
Description copied from interface: RemoteRelocator
This method starts or cancels a drag & drop operation. This method simulates a mouse-pressed event.

Specified by:
init in interface RemoteRelocator
Parameters:
x - the x-coordinate on the screen, where the (simulated) event occurred
y - the y-coordinate on the screen, where the (simulated) event occurred
dx - the x-coordinate of the mouse on the simulated Component which sent the event, 0 is a good default-value.
dy - the y-coordinate of the mouse on the simulated Component which sent the event, 0 is a good default-value.
modifiers - the state of the mouse, see InputEvent.getModifiersEx().
Returns:
how this remote reacts on the call, see RemoteRelocator.Reaction