|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.DockController
public class DockController
A controller is needed to drag and drop dockables
from
one DockStation
to another station.
In order to use a station, it must be added
to a controller. Stations which are children of other stations will be
added automatically. Dockables can only be dragged and dropped from
stations with the same controller.
Note: if a controller is no longer in use, the method kill()
should
be called to free some resources.
Constructor Summary | |
---|---|
|
DockController()
Creates a new controller. |
protected |
DockController(boolean initiate)
Creates a new controller but does not initiate the properties of this controller if not wished. |
Method Summary | |
---|---|
void |
add(DockStation station)
Adds a station to this controller. |
void |
addAcceptance(DockAcceptance acceptance)
Adds a rule that decides which station can have which children. |
void |
addActionGuard(ActionGuard guard)
Adds guard to this controller. |
void |
addActionOffer(ActionOffer offer)
Adds a factory for a DockActionSource . |
void |
addDockControllerListener(DockControllerListener listener)
Adds an observer to this controller. |
protected ActionViewConverter |
createActionViewConverter()
Creates the converter that will transform actions into views. |
protected ActionOffer |
createDefaultActionOffer()
Creates the default action offer. |
protected DockRegisterListener |
createFocusController()
Creates a listener which will observe all stations to ensure that the focused Dockable is always visible. |
protected MouseFocusObserver |
createMouseFocusObserver()
Creates the focus-controller of this controller. |
protected DockRegisterListener |
createPopupController()
Creates a listener which will open a popup-menu for each title or dockable known to this controller. |
protected DockRegister |
createRegister()
Creates a new register for this controller. |
protected DockRelocator |
createRelocator()
Creates a new relocator for this controller. |
protected SingleParentRemover |
createSingleParentRemover()
Creates a SingleParentRemover that will be used to remove
some stations from this controller. |
void |
ensureFocusSet()
Ensures that a title or a Component of the currently
focused Dockable really
has the focus. |
protected void |
firedockableFocused(Dockable dockable)
Informs all listeners that dockable has gained
the focus. |
protected void |
fireTitleBound(DockTitle title,
Dockable dockable)
Informs all listeners that title has been bound
to dockable . |
protected void |
fireTitleUnbound(DockTitle title,
Dockable dockable)
Informs all listeners that title is no longer bound
to dockable . |
MultiDockAcceptance |
getAcceptance()
Gets the behavior that tells which stations can have which children. |
ActionViewConverter |
getActionViewConverter()
Gets the current ActionViewConverter . |
ActionOffer |
getDefaultActionOffer()
Gets the factory for a DockActionSource which is used
if no other offer was interested
in a Dockable . |
DockTitleManager |
getDockTitleManager()
Gets the manager of all titles on this controller |
Dockable |
getFocusedDockable()
Gets the Dockable which is currently focused. |
MouseFocusObserver |
getFocusObserver()
Gets the current focus-controller |
IconManager |
getIcons()
Gets the set of icons which are used by this controller. |
ActionPopupSuppressor |
getPopupSuppressor()
Gets the guard which decides, which popups should be allowed. |
DockProperties |
getProperties()
A set of properties that can be used at any place. |
DockRegister |
getRegister()
Gets the set of Dockables and DockStations
known to this controller. |
DockRelocator |
getRelocator()
Gets the manager for handling drag and drop operations. |
DockStation |
getStation(int index)
Gets the station at the specified position. |
int |
getStationCount()
Gest the number of stations registered at this controller. |
DockTheme |
getTheme()
Gets the current theme of this controller. |
protected void |
initiate()
Initializes all properties of this controller. |
boolean |
isBound(DockTitle title)
Tells whether title is bound to its dockable or not. |
boolean |
isFocused(Dockable dockable)
Tells whether dockable or one of its children
has currently the focus. |
boolean |
isOnFocusing()
Tells whether one of the methods which change the focus is currently running, or not. |
boolean |
isSingleParentRemove()
Tells whether stations with only one child are removed or not. |
void |
kill()
Removes listeners and frees resources. |
protected DockControllerListener[] |
listDockControllerListener()
Lists all DockControllerListener of this station. |
DockActionSource |
listOffers(Dockable dockable)
Creates a list of DockActions which can
affect Dockable . |
void |
remove(DockStation station)
Removes a station which was managed by this controller. |
void |
removeAcceptance(DockAcceptance acceptance)
Removes a that decided which station could have which children. |
void |
removeActionGuard(ActionGuard guard)
Removes guard from this controller. |
void |
removeActionOffer(ActionOffer offer)
Removes an earlier added offer. |
void |
removeDockControllerListener(DockControllerListener listener)
Removes an observer from this controller. |
void |
setAtLeastFocusedDockable(Dockable focusedDockable)
Sets the focused Dockable . |
void |
setDefaultActionOffer(ActionOffer defaultActionOffer)
Sets the factory for a DockActionSource which is used
if no other offer was interested
in a Dockable . |
void |
setFocusedDockable(Dockable focusedDockable,
boolean force)
Sets the Dockable which should have the focus. |
void |
setFocusedDockable(Dockable focusedDockable,
boolean force,
boolean ensureFocusSet)
Sets the Dockable which should have the focus. |
void |
setPopupSuppressor(ActionPopupSuppressor popupSuppressor)
Sets the guard which decides, which popups with DockActions
are allowed to show up, and which popups will be suppressed. |
void |
setSingleParentRemove(boolean remove)
Sets whether stations with one or none child are removed automatically or not. |
void |
setTheme(DockTheme theme)
Sets the theme of this controller. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DockController()
protected DockController(boolean initiate)
initiate()
if the pass false
to this constructor.
Otherwise the behavior of this controller is unspecified.
initiate
- true
if all properties should be initiatedMethod Detail |
---|
protected final void initiate()
DockController(boolean)
with an argument false
.
createRegister()
,
createRelocator()
,
createDefaultActionOffer()
,
createMouseFocusObserver()
,
createActionViewConverter()
,
createFocusController()
,
createPopupController()
public void kill()
protected DockRegister createRegister()
protected DockRelocator createRelocator()
protected DockRegisterListener createFocusController()
Dockable
is always visible.
null
protected DockRegisterListener createPopupController()
null
protected MouseFocusObserver createMouseFocusObserver()
null
public MouseFocusObserver getFocusObserver()
public DockRegister getRegister()
Dockables
and DockStations
known to this controller.
public DockRelocator getRelocator()
protected ActionViewConverter createActionViewConverter()
public ActionViewConverter getActionViewConverter()
ActionViewConverter
.
protected ActionOffer createDefaultActionOffer()
ActionOffer
will
be used if no other offer was interested in a Dockable.
null
public boolean isSingleParentRemove()
true
if stations with one or less
children are removed automaticallysetSingleParentRemove(boolean)
public void setSingleParentRemove(boolean remove)
added
.
remove
- true
if stations with one or less
children are removedcreateSingleParentRemover()
protected SingleParentRemover createSingleParentRemover()
SingleParentRemover
that will be used to remove
some stations from this controller.
setSingleParentRemove(boolean)
public MultiDockAcceptance getAcceptance()
addAcceptance(DockAcceptance)
,
removeAcceptance(DockAcceptance)
public void addAcceptance(DockAcceptance acceptance)
acceptance
does not override the
accept
-methods of Dockable
and DockStation
.
acceptance
- the additional rulepublic void removeAcceptance(DockAcceptance acceptance)
acceptance
- the rule to removepublic ActionPopupSuppressor getPopupSuppressor()
setPopupSuppressor(ActionPopupSuppressor)
public void setPopupSuppressor(ActionPopupSuppressor popupSuppressor)
DockActions
are allowed to show up, and which popups will be suppressed.
popupSuppressor
- the guardpublic ActionOffer getDefaultActionOffer()
DockActionSource
which is used
if no other offer was interested
in a Dockable
.
public void setDefaultActionOffer(ActionOffer defaultActionOffer)
DockActionSource
which is used
if no other offer was interested
in a Dockable
.
defaultActionOffer
- the offer, not null
public void addActionOffer(ActionOffer offer)
DockActionSource
. The factory will
create a source if it is the first offer which is
interested
in a Dockable
.
offer
- the algorithmpublic void removeActionOffer(ActionOffer offer)
offer
- the factory to removepublic void setTheme(DockTheme theme)
theme
- the new themepublic DockTheme getTheme()
public DockProperties getProperties()
public void add(DockStation station)
station
. If
the children of station
are stations itself, then
they will be added automatically
station
- the new stationpublic void remove(DockStation station)
station
- the station to removepublic int getStationCount()
add(DockStation)
public DockStation getStation(int index)
index
- the location
public boolean isOnFocusing()
true
, none should
change the focus.
true
if the focus is currently changingpublic void setAtLeastFocusedDockable(Dockable focusedDockable)
Dockable
. If focusedDockable
is a station and one of its children has the focus, then nothing will
happen.
focusedDockable
- the element which should have the focusisOnFocusing()
public void setFocusedDockable(Dockable focusedDockable, boolean force)
Dockable
which should have the focus.
focusedDockable
- the element with the focus or null
force
- true
if this controller must ensure
that all properties are correct, false
if some
optimations are allowed. Clients normally can set this argument
to false
.public void setFocusedDockable(Dockable focusedDockable, boolean force, boolean ensureFocusSet)
Dockable
which should have the focus.
focusedDockable
- the element with the focus or null
force
- true
if this controller must ensure
that all properties are correct, false
if some
optimations are allowed. Clients normally can set this argument
to false
.ensureFocusSet
- whether to ensure that the focus is set correctly
or not.public boolean isFocused(Dockable dockable)
dockable
or one of its children
has currently the focus.
dockable
- the element which may have the focus
true
if dockable
or
one of its children is focusedpublic boolean isBound(DockTitle title)
title
is bound to its dockable or not. The
behavior is unspecified if the dockable of title
is
unknown to this controller.
title
- the title which might be bound
true
if the title is boundpublic void ensureFocusSet()
Component
of the currently
focused Dockable
really
has the focus.
public Dockable getFocusedDockable()
Dockable
which is currently focused.
null
public DockTitleManager getDockTitleManager()
public IconManager getIcons()
public void addActionGuard(ActionGuard guard)
guard
to this controller. The new
ActionGuard
has no influence on
DockActionSources
which are already
created.
guard
- the new guardpublic void removeActionGuard(ActionGuard guard)
guard
from this controller.
guard
- the element to removepublic DockActionSource listOffers(Dockable dockable)
DockActions
which can
affect Dockable
.Dockable.getGlobalActionOffers()
to
get a list of actions for a specific Dockable. This method only uses
the local information to compute a new source.
dockable
- a Dockable whose actions are demanded
public void addDockControllerListener(DockControllerListener listener)
listener
- the observerpublic void removeDockControllerListener(DockControllerListener listener)
listener
- the observer to removeprotected DockControllerListener[] listDockControllerListener()
DockControllerListener
of this station. The list is
independent from the original list.
protected void fireTitleBound(DockTitle title, Dockable dockable)
title
has been bound
to dockable
.
title
- the bound titledockable
- the owner of title
protected void fireTitleUnbound(DockTitle title, Dockable dockable)
title
is no longer bound
to dockable
.
title
- the unbound titledockable
- the former owner of title
protected void firedockableFocused(Dockable dockable)
dockable
has gained
the focus.
dockable
- the owner of the focus, may be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |