|
||||||||||
| 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,
AWTEvent event)
Tries to find the Dockable which owns component
and sets this Dockable to the focusedDockable. |
protected void |
check(Component component,
boolean ensureFocus,
boolean requestFocusInWindow,
AWTEvent event)
Tries to find the Dockable which owns component
and sets this Dockable to the focusedDockable. |
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 FocusVetoListener.FocusVeto |
fireVetoDockable(Dockable dockable)
Asks all FocusVetoListener through their method
FocusVetoListener.vetoFocus(MouseFocusObserver, Dockable)
whether they want cancel a call to the DockController. |
protected FocusVetoListener.FocusVeto |
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,
AWTEvent event)
Gets the top-dockable which has component or
parent of component as base Component. |
protected void |
handleVeto(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(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 |
| 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 FocusVetoListener.FocusVeto 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
protected FocusVetoListener.FocusVeto 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
protected 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 changed
protected void handleVeto(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(Component component,
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 check
protected void check(Component component,
boolean ensureFocus,
boolean requestFocusInWindow,
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 check
public void init(DockController controller,
Dockable dockable)
DockRelocatorListener
init in interface DockRelocatorListenercontroller - the origin of the eventdockable - the element that has been grabbed
public void cancel(DockController controller,
Dockable dockable)
DockRelocatorListenerDockRelocatorListener.init(DockController, Dockable).
was called.
cancel in interface DockRelocatorListenercontroller - the origin of the eventdockable - the element that has been grabbed
public void drag(DockController controller,
Dockable dockable,
DockStation station)
DockRelocatorListenerdockable
is dragged from its old parent.
drag in interface DockRelocatorListenercontroller - the origin of the eventdockable - the Dockable which was draggedstation - the future parent of dockableDockRelocatorListener.drop(DockController, Dockable, DockStation)
public void drop(DockController controller,
Dockable dockable,
DockStation station)
DockRelocatorListenerDockable was dropped.
drop in interface DockRelocatorListenercontroller - the origin of the eventdockable - the Dockable which was draggedstation - the new parent of dockableDockRelocatorListener.drag(DockController, Dockable, DockStation)
protected Dockable getDockable(Component component,
AWTEvent event)
component or
parent of component as base Component.
component - a Componentevent - the event that causes this check
null if nothing was found or
a FocusVetoListener doesn't want to inform the controller
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||