|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Dockable
A Dockable is a window which is put onto a DockStation
. The user
can grab a Dockable and drag it to another station.
A Dockable has some properties:
DockStation
which is the parent of the DockableDockController
which is responsible to allow the user to
drag the Dockable.Component
which represents the DockableDockActionSource
which provides some DockActions
.
Each of the action can be triggered by the user, and can execute any it likes.
Method Summary | |
---|---|
boolean |
accept(DockStation station)
Tells whether station is an accepted parent for this
Dockable or not. |
boolean |
accept(DockStation base,
Dockable neighbor)
Tells whether base could be the parent of a combination
between this Dockable and neighbor . |
void |
addDockableListener(DockableListener listener)
Adds a listener to this Dockable. |
void |
addDockHierarchyListener(DockHierarchyListener listener)
Adds a hierarchy-listener to this Dockable. |
void |
addMouseInputListener(MouseInputListener listener)
Adds a MouseInputListener to the component of this Dockable. |
void |
bind(DockTitle title)
Called by clients which want to show a title of this Dockable. |
Component |
getComponent()
Gets the Component which represents this Dockable. |
DockController |
getController()
Gets the current controller, the argument of the last call of setController(DockController) . |
DockStation |
getDockParent()
Gets the current parent, which is the last argument of setDockParent(DockStation) . |
DockTitle |
getDockTitle(DockTitleVersion version)
Invoked to get a graphical representation of a title for this Dockable. There are several requirements to the title and the caller: The owner of the title must be this Dockable.
The origin of the title must be version .
The title must not be bound
The result should be independent of the current state of this Dockable.
The method should not change any attribute of this Dockable
The client must call the bind(DockTitle) -method of this Dockable
before using the title. |
DockActionSource |
getGlobalActionOffers()
Gets a list of all DockAction s which
might be triggered while this Dockable is visible. |
DockActionSource |
getLocalActionOffers()
Gets a list of DockAction s which should be triggerable if
this Dockable is visible. |
Icon |
getTitleIcon()
Gets the current icon of this Dockable. |
String |
getTitleText()
Gest the current title-text of this Dockable. |
DockTitle[] |
listBoundTitles()
Gets a list of all DockTitles which are currently
bound to this Dockable. |
void |
removeDockableListener(DockableListener listener)
Removes a listener from this Dockable. |
void |
removeDockHierarchyListener(DockHierarchyListener listener)
Removes a hierarchy-listener from this Dockable. Note: when using a DockHierarchyObserver ,
forward the call directly to DockHierarchyObserver.removeDockHierarchyListener(DockHierarchyListener) |
void |
removeMouseInputListener(MouseInputListener listener)
Removes a listener that was earlier added to this Dockable. |
void |
setController(DockController controller)
Sets the controller in whose realm this Dockable is. |
void |
setDockParent(DockStation station)
Sets the parent property. |
void |
unbind(DockTitle title)
Clients should call this method if a DockTitle is no longer
needed. |
Methods inherited from interface bibliothek.gui.dock.DockElement |
---|
asDockable, asDockStation, getFactoryID |
Method Detail |
---|
void setDockParent(DockStation station)
station
.DockHierarchyEvent
.DockHierarchyObserver
, invoke
DockHierarchyObserver.update()
after the
property has changed, and do not fire a DockHierarchyEvent
here.
station
- the parent, may be null
if this
Dockable is not visible at all.DockStation getDockParent()
setDockParent(DockStation)
.
null
void setController(DockController controller)
null
means that this Dockable
is not managed by a controller.DockHierarchyListener
s about the change.DockHierarchyObserver
, invoke
DockHierarchyObserver.controllerChanged(DockController)
controller
- the owner, may be null
DockController getController()
setController(DockController)
.
null
void addDockableListener(DockableListener listener)
listener
- the new listenervoid removeDockableListener(DockableListener listener)
listener
- the listener to removevoid addDockHierarchyListener(DockHierarchyListener listener)
DockHierarchyObserver
to implement this feature in an easy way. Subclasses then only have
to call DockHierarchyObserver.update()
whenever the parent
of this Dockable
changes.DockHierarchyObserver
,
forward the call directly to DockHierarchyObserver.addDockHierarchyListener(DockHierarchyListener)
listener
- the new listenervoid removeDockHierarchyListener(DockHierarchyListener listener)
DockHierarchyObserver
,
forward the call directly to DockHierarchyObserver.removeDockHierarchyListener(DockHierarchyListener)
listener
- the listener to removeaddDockableListener(DockableListener)
void addMouseInputListener(MouseInputListener listener)
MouseInputListener
to the component of this Dockable.
A Dockable has to decide by itself which Components
should be observer, but generally all free areas should be covered.
It's also possible just to ignore the listener, but that's not the
preferred behavior.
listener
- the mouse listenervoid removeMouseInputListener(MouseInputListener listener)
listener
- The listener to removeboolean accept(DockStation station)
station
is an accepted parent for this
Dockable or not. The user is not able to drag a Dockable to a station
which is not accepted.
station
- a possible parent
station
could be a parent or notboolean accept(DockStation base, Dockable neighbor)
base
could be the parent of a combination
between this Dockable and neighbor
. The user is not able
to make a combination between this Dockable and neighbor
if this method does not accept the operation.
base
- the future parent of the combinationneighbor
- a Dockable whose parent will be the same parent as
the parent of this Dockable
true
if the combination is allowed, false
otherwiseComponent getComponent()
Component
which represents this Dockable. Note that
the component should be a
focus cycle root
String getTitleText()
Icon getTitleIcon()
null
DockTitle getDockTitle(DockTitleVersion version)
owner
of the title must be this Dockable.origin
of the title must be version
.bind(DockTitle)
-method of this Dockable
before using the title. Note that a client must not call the
bind-method of DockTitleunbind(DockTitle)
-method when he no
longer needs the title. Note that the client must not call the
unbind-method of the DockTitle
version
- which title is required. If this Dockable does not have
a special rule for the given version, it can return the result of
DockTitleVersion.createDockable(Dockable)
.
null
if no title should be shown.
Note that not all clients can handle a null
-title, if in
doubt, return a title.void bind(DockTitle title)
DockTitle.bind()
will be called automatically by the
controller.title
was bound. However, the method DockTitle.bind()
must not
be invoked by this method.title
must be returned by listBoundTitles()
unless unbind(DockTitle)
is called.
title
- the title which will be show some things of this Dockable
IllegalArgumentException
- if the title is already boundunbind(DockTitle)
void unbind(DockTitle title)
DockTitle
is no longer
needed. The controller will call DockTitle.unbind()
at an appropriate
time.title
is no longer bound. However, this method must not call
DockTitle.unbind()
.title
must no longer be returned when calling listBoundTitles()
title
- the title which will be no longer connected to this
Dockable
IllegalArgumentException
- if the title is not known to this dockablebind(DockTitle)
DockTitle[] listBoundTitles()
DockTitles
which are currently
bound to this Dockable. That are titles for which bind(DockTitle)
was called, but not yet unbind(DockTitle)
.
DockActionSource getLocalActionOffers()
DockAction
s which should be triggerable if
this Dockable is visible. The list contains only actions which are
directly bound to this Dockable (the actions which are not changed when
the parent-station of this Dockable is exchanged).
The list can be modified by this Dockable at every time, clients have
to react on these changes by adding
a DockActionSourceListener
to the result.
null
if no actions
are availableDockActionSource getGlobalActionOffers()
DockAction
s which
might be triggered while this Dockable is visible. The list must contain
all actions which are related in any way to this Dockable. Subclasses
might use a HierarchyDockActionSource
or the method
DockController.listOffers(Dockable)
to get this functionality
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |