|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface RemoteRelocator
A remote relocator can be used to perform a drag & drop operation of a
Dockable without the need to know more than the Dockable.
The methods of this interface correspond to methods which are used in
MouseListener and MouseMotionListener:
init(int, int, int, int, int) |
MouseListener.mousePressed(MouseEvent) |
drag(int, int, int) |
MouseMotionListener.mouseDragged(MouseEvent) |
drop(int, int, int) |
MouseListener.mouseReleased(MouseEvent) |
RemoteRelocator.Reaction. A result that is
CONTINUE or
CONTINUE_CONSUMED means, that
the relocator is not yet finished with the operation. Further events have to
be sent to the relocator.BREAK or
BREAK_CONSUMED, then
the relocator has finished the operation.BREAK_CONSUMED or
CONTINUE_CONSUMED,
then the relocator has "used up" the event. If the client uses existing
MouseEvents to call the methods, then InputEvent.consume()
should be invoked.
x and y). The
methods need also information which buttons are currently pressed
(argument modifiers). Have a look at InputEvent.getModifiersEx()
to find out, how modifiers has to be encoded.
MouseListener and a MouseMotionListener
which are both added to the same Component. The events received
by these listeners can be safely and unchecked forwarded to the relocator,
as long as the Component represents only one Dockable.Component represents more than one Dockable,
then each event should be delivered only to one RemoteRelocator.
If that relocator is interested in the event, all other events have to be
forwarded to the same relocator, until the relocator is no longer interested
in the events. That includes events which would normally be sent to another
relocator.Dockable, then they
can substitute each other at any time.cancel().
Afterwards no events have to be sent to the relocator any more (it is not forbidden to
send more events).RemoveRelocators can be delivered by
DockRelocator.createRemote(Dockable).
| Nested Class Summary | |
|---|---|
static class |
RemoteRelocator.Reaction
Tells a caller of a method whether the RemoteRelocator has
finished the drag & drop operation or not. |
| Method Summary | |
|---|---|
void |
cancel()
Cancels the current drag & drop operation. |
RemoteRelocator.Reaction |
drag(int x,
int y,
int modifiers)
This method works on the drag-part of a drag & drop operation. |
RemoteRelocator.Reaction |
drop(int x,
int y,
int modifiers)
This method works on the drop-part of 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 interface bibliothek.gui.dock.control.BasicRemoteRelocator |
|---|
setShowImageWindow, setTitle |
| Method Detail |
|---|
RemoteRelocator.Reaction init(int x,
int y,
int dx,
int dy,
int modifiers)
x - the x-coordinate on the screen, where the (simulated) event occurredy - the y-coordinate on the screen, where the (simulated) event occurreddx - 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().
RemoteRelocator.Reaction
RemoteRelocator.Reaction drag(int x,
int y,
int modifiers)
x - the x-coordinate on the screen, where the (simulated) event occurredy - the y-coordinate on the screen, where the (simulated) event occurredmodifiers - the state of the mouse, see InputEvent.getModifiersEx().
RemoteRelocator.Reaction
RemoteRelocator.Reaction drop(int x,
int y,
int modifiers)
RemoteRelocator.Reaction
x - the x-coordinate on the screen, where the (simulated) event occurredy - the y-coordinate on the screen, where the (simulated) event occurredmodifiers - the state of the mouse, see InputEvent.getModifiersEx().
RemoteRelocator.Reactionvoid cancel()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||