|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.control.MouseFocusObserver
public abstract class MouseFocusObserver
A FocusController listens to all AWT-events. As soon as the mouse is pressed
over a Dockable
, the FocusController will inform the DockController
about a new front-dockable
.
Constructor Summary | |
---|---|
MouseFocusObserver(DockController controller,
ControllerSetupCollection setup)
Creates a new FocusController. |
Method Summary | |
---|---|
void |
addVetoListener(FocusVetoListener listener)
Adds a listener to this controller which can cancel a call to the DockController . |
void |
cancel(DockController controller,
Dockable dockable)
Invoked when a drag and drop operation was initiated, but canceld. |
protected void |
check(AWTEvent event)
Lets check this controller whether the focus should change, or not. |
protected void |
check(Component component)
Tries to find the Dockable which owns component
and sets this Dockable to the focusedDockable. |
protected void |
check(Component component,
boolean ensureFocus)
Tries to find the Dockable which owns component
and sets this Dockable to the focusedDockable. |
void |
dockableCycledRegister(DockController controller,
Dockable dockable)
Invoked when dockable was added and removed from the controller , or
was removed and added again to controller . |
void |
dockableFocused(DockController controller,
Dockable dockable)
|
void |
dockableRegistered(DockController controller,
Dockable dockable)
Invoked after a Dockable was registered. |
void |
dockableRegistering(DockController controller,
Dockable dockable)
Invoked right before the dockable is registered in the
controller . |
void |
dockableUnregistered(DockController controller,
Dockable dockable)
Invoked after dockable has been unregistered from controller . |
void |
dockStationRegistered(DockController controller,
DockStation station)
Invoked after a DockStation was registered. |
void |
dockStationRegistering(DockController controller,
DockStation station)
Invoked right before the station is registered in
the controller . |
void |
dockStationUnregistered(DockController controller,
DockStation station)
Invoked after station has been unregistered from controller . |
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. |
protected boolean |
fireVetoDockable(Dockable dockable)
Asks all FocusVetoListener through their method
FocusVetoListener.vetoFocus(MouseFocusObserver, Dockable)
whether they want cancel a call to the DockController . |
protected boolean |
fireVetoTitle(DockTitle title)
Asks all FocusVetoListener through their method
FocusVetoListener.vetoFocus(MouseFocusObserver, DockTitle)
whether they want cancel a call to the DockController . |
DockController |
getController()
Gets the affected controller. |
protected Dockable |
getDockable(Component component)
Gets the top-dockable which has component or
parent of component as base Component. |
void |
init(DockController controller,
Dockable dockable)
Invoked when a drag and drop operation is initiated. |
protected boolean |
interact(AWTEvent event)
Tells whether this event should change the focus. |
void |
kill()
Stops this FocusController. |
void |
removeVetoListener(FocusVetoListener listener)
Removes a listener from this controller |
void |
titleBound(DockController controller,
DockTitle title,
Dockable dockable)
Called when title was bound
to dockable . |
void |
titleUnbound(DockController controller,
DockTitle title,
Dockable dockable)
Called when title was unbound
from dockable . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MouseFocusObserver(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()
public DockController getController()
public void addVetoListener(FocusVetoListener listener)
DockController
.
listener
- the new listenerpublic void removeVetoListener(FocusVetoListener listener)
listener
- the listener to removeprotected boolean fireVetoTitle(DockTitle title)
FocusVetoListener
through their method
FocusVetoListener.vetoFocus(MouseFocusObserver, DockTitle)
whether they want cancel a call to the DockController
.
title
- the title which was hit by the mouse
true
if at least one veto was made,
false
otherwiseprotected boolean fireVetoDockable(Dockable dockable)
FocusVetoListener
through their method
FocusVetoListener.vetoFocus(MouseFocusObserver, Dockable)
whether they want cancel a call to the DockController
.
dockable
- the Dockable which was hit by the mouse
true
if at least one veto was made,
false
otherwiseprotected void check(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(AWTEvent event)
event
- the event
true
if the focus could be changedprotected void check(Component component)
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
focusedprotected void check(Component component, boolean ensureFocus)
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.public void dockableRegistered(DockController controller, Dockable dockable)
DockRegisterListener
Dockable
was registered. Note that this method can
be called while a Dockable
is dragged. See the method
DockController
.isOnMove()
.
dockableRegistered
in interface DockRegisterListener
controller
- the controller where dockable
was addeddockable
- the Dockable
that was addedpublic 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)
public void dockableUnregistered(DockController controller, Dockable dockable)
DockRegisterListener
dockable
has been unregistered from controller
.
Note that this method can be invoked while a Dockable
is dragged,
use the method DockController
.isOnMove()
.
dockableUnregistered
in interface DockRegisterListener
controller
- the controller from where dockable
was removeddockable
- the removed Dockable
public void dockableCycledRegister(DockController controller, Dockable dockable)
DockRegisterListener
dockable
was added and removed from the controller
, or
was removed and added again to controller
. This method is only
invoked if a call to DockRegisterListener.dockableRegistered(DockController, Dockable)
and
DockRegisterListener.dockableUnregistered(DockController, Dockable)
was suppressed. It
is unknown whether dockable
is now registered at controller
.
dockableCycledRegister
in interface DockRegisterListener
controller
- the controller whose register dockable
cycleddockable
- some Dockable
public void titleBound(DockController controller, DockTitle title, Dockable dockable)
DockTitleBindingListener
title
was bound
to dockable
.
This method is called after the DockTitle.bind()
-method
was invoked.
titleBound
in interface DockTitleBindingListener
controller
- the origin of the eventtitle
- the DockTitle
that was bounddockable
- the owner of title
public void titleUnbound(DockController controller, DockTitle title, Dockable dockable)
DockTitleBindingListener
title
was unbound
from dockable
.
This method is called after the DockTitle.bind()
-method
was invoked.
titleUnbound
in interface DockTitleBindingListener
controller
- the origin of the eventtitle
- the DockTitle
which was unbounddockable
- the old owner of title
protected Dockable getDockable(Component component)
component
or
parent of component
as base Component.
component
- a Component
null
if nothing was found or
a FocusVetoListener
doesn't want to inform the controllerpublic void dockStationUnregistered(DockController controller, DockStation station)
DockRegisterListener
station
has been unregistered from controller
.
Note that this method can be invoked while a Dockable
is dragged,
use the method DockController
.isOnMove()
.
dockStationUnregistered
in interface DockRegisterListener
controller
- the controller from where dockable
was removedstation
- the removed DockStation
public void dockStationRegistered(DockController controller, DockStation station)
DockRegisterListener
DockStation
was registered. This method can
be called while a Dockable
is dragged. See the method
DockController
.isOnMove()
.
dockStationRegistered
in interface DockRegisterListener
controller
- the controller where station
was addedstation
- the DockStation
that was addedpublic void dockableRegistering(DockController controller, Dockable dockable)
DockRegisterListener
dockable
is registered in the
controller
.
dockableRegistering
in interface DockRegisterListener
controller
- the controller who does not yet know dockable
.dockable
- the dockable who does not yet know controller
.public void dockStationRegistering(DockController controller, DockStation station)
DockRegisterListener
station
is registered in
the controller
.
dockStationRegistering
in interface DockRegisterListener
controller
- the controller who does not yet know station
.station
- the station who does not yet know controller
.public void dockableFocused(DockController controller, Dockable dockable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |