|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.control.focus.AbstractMouseFocusObserver
public abstract class AbstractMouseFocusObserver
This abstract implementation of a MouseFocusObserver
offers methods to handle
FocusVetoListener
s and registers itself as DockRelocatorListener
. On a
drop event
this observer
will automatically transfer the focus to the dropped Dockable
.
Constructor Summary | |
---|---|
AbstractMouseFocusObserver(DockController controller,
ControllerSetupCollection setup)
Creates a new FocusController. |
Method Summary | |
---|---|
void |
cancel(DockController controller,
Dockable dockable)
Invoked when a drag and drop operation was initiated, but canceld. |
protected void |
check(java.awt.AWTEvent event)
Lets check this controller whether the focus should change, or not. |
protected void |
check(java.awt.Component component,
java.awt.AWTEvent event)
Tries to find the Dockable which owns component
and sets this Dockable to the focusedDockable. |
protected void |
check(java.awt.Component component,
boolean ensureFocus,
boolean requestFocusInWindow,
java.awt.AWTEvent event)
Tries to find the Dockable which owns component
and sets this Dockable to the focusedDockable. |
void |
check(java.awt.event.MouseEvent event)
This method may be called at any time by any component that received the MouseEvent event . |
void |
check(java.awt.event.MouseWheelEvent event)
This method may be called at any time by any component that received the MouseWheelEvent event . |
void |
drag(DockController controller,
Dockable dockable,
DockStation station)
Invoked when a drag and drop operation has been confirmed. |
void |
drop(DockController controller,
Dockable dockable,
DockStation station)
Invoked after a Dockable was dropped. |
DockController |
getController()
Gets the affected controller. |
protected DockElementRepresentative |
getDockable(java.awt.Component component,
java.awt.AWTEvent event)
Gets the top-dockable which has component or
parent of component as base Component. |
protected void |
handleVeto(java.awt.AWTEvent event,
FocusVetoListener.FocusVeto veto)
Handles the veto that was given when trying to forward event . |
void |
init(DockController controller,
Dockable dockable)
Invoked when a drag and drop operation is initiated. |
protected boolean |
interact(java.awt.AWTEvent event)
Tells whether this event should change the focus. |
void |
kill()
Stops this FocusController. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractMouseFocusObserver(DockController controller, ControllerSetupCollection setup)
controller
- the controller which will be informed about
focus-changessetup
- an observable informing this object when controller
is set up.Method Detail |
---|
public void kill()
kill
in interface MouseFocusObserver
public DockController getController()
getController
in interface MouseFocusObserver
public void check(java.awt.event.MouseEvent event)
MouseFocusObserver
MouseEvent
event
. This observer may transfer the
focus because of this call.restricted environment
than any DockStation
of this framework will call this method.
check
in interface MouseFocusObserver
event
- the event to checkpublic void check(java.awt.event.MouseWheelEvent event)
MouseFocusObserver
MouseWheelEvent
event
. This observer may transfer the
focus because of this call.restricted environment
than any DockStation
of this framework will call this method.
check
in interface MouseFocusObserver
event
- the event to checkprotected void check(java.awt.AWTEvent event)
event
is
allowed to change the focus or not. This check can be done through the
method interact(AWTEvent)
.
event
- The event to react on.interact(AWTEvent)
protected boolean interact(java.awt.AWTEvent event)
event
- the event
true
if the focus could be changedprotected void handleVeto(java.awt.AWTEvent event, FocusVetoListener.FocusVeto veto)
event
. The default implementation calls
InputEvent.consume()
to get rid of the event.
event
- the event to handleveto
- which veto was called by a FocusVetoListener
protected void check(java.awt.Component component, java.awt.AWTEvent event)
component
and sets this Dockable to the focusedDockable. The method
only succeeds if no veto-listener reacts.
component
- the component whose dockable parent is to set
focusedevent
- the event that causes this checkprotected void check(java.awt.Component component, boolean ensureFocus, boolean requestFocusInWindow, java.awt.AWTEvent event)
component
and sets this Dockable to the focusedDockable. The method
only succeeds if no veto-listener reacts.
component
- the component whose dockable parent is to set
focusedensureFocus
- whether the DockController should ensure
that the focus is set correctly or not.requestFocusInWindow
- whether Component.requestFocusInWindow()
should be
called or notevent
- the event that causes this checkpublic void init(DockController controller, Dockable dockable)
DockRelocatorListener
init
in interface DockRelocatorListener
controller
- the origin of the eventdockable
- the element that has been grabbedpublic void cancel(DockController controller, Dockable dockable)
DockRelocatorListener
DockRelocatorListener.init(DockController, Dockable)
.
was called.
cancel
in interface DockRelocatorListener
controller
- the origin of the eventdockable
- the element that has been grabbedpublic void drag(DockController controller, Dockable dockable, DockStation station)
DockRelocatorListener
dockable
is dragged from its old parent.
drag
in interface DockRelocatorListener
controller
- the origin of the eventdockable
- the Dockable
which was draggedstation
- the future parent of dockable
DockRelocatorListener.drop(DockController, Dockable, DockStation)
public void drop(DockController controller, Dockable dockable, DockStation station)
DockRelocatorListener
Dockable
was dropped.
drop
in interface DockRelocatorListener
controller
- the origin of the eventdockable
- the Dockable
which was draggedstation
- the new parent of dockable
DockRelocatorListener.drag(DockController, Dockable, DockStation)
protected DockElementRepresentative getDockable(java.awt.Component component, java.awt.AWTEvent event)
component
or
parent of component
as base Component.
component
- a Componentevent
- the event that causes this check
null
if nothing was found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |