@LayoutLocked(locked=false) public class DockRegister extends Object
Dockables and
DockStations currently used in the
system.| Constructor and Description |
|---|
DockRegister(DockController controller)
Creates a new register.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(DockStation station)
Adds a station to this register.
|
void |
addDockRegisterListener(DockRegisterListener listener)
Registers a listener which will receive notifications when a
Dockable or a DockStation is added or removed from
this register. |
protected void |
fireDockableRegistered(Dockable dockable)
Informs all registerListeners that a
Dockable has been registered. |
protected void |
fireDockableRegistering(Dockable dockable)
Informs all registerListeners that a
Dockable will be registered. |
protected void |
fireDockableUnregistered(Dockable dockable)
Informs all registerListeners that a
Dockable has been
unregistered. |
protected void |
fireDockStationRegistered(DockStation station)
Informs all registerListeners that
station has been registered. |
protected void |
fireDockStationRegistering(DockStation station)
Informs all registerListeners that
station will be registered. |
protected void |
fireDockStationUnregistered(DockStation station)
Informs all registerListeners that
station has been unregistered. |
protected void |
fireStalled()
Informs all
DockRegisterListener that this DockRegister is
stalled. |
protected void |
fireStalledChange(Dockable dockable)
Informs all RegisterListeners that
dockable cycled
the register. |
protected void |
fireUnstalled()
Informs all
DockRegisterListeners that this DockRegister is
no longer stalled. |
DockController |
getController()
Gets the controller for which this register stores Dockables and DockStations.
|
Dockable |
getDockable(int index)
Gets the index'th
Dockable that is registered at this DockRegister. |
int |
getDockableCount()
Gets the number of dockables registered at this
DockRegister. |
DockStation |
getStation(int index)
Gets the station at the specified position.
|
int |
getStationCount()
Gest the number of stations that are registered.
|
boolean |
isProtected(DockStation station)
Tells whether
station is protected. |
boolean |
isRegistered(Dockable dockable)
Tells whether
dockable is known to this register. |
boolean |
isStalled()
Whether the register is currently stalled and does not forward
changes to the tree.
|
void |
kill()
Removes all registerListeners and connections to the stations and dockables
known to this register.
|
Dockable[] |
listDockables()
Gets a list of all Dockables.
|
protected DockRegisterListener[] |
listDockRegisterListeners()
Gets a list of all registerListeners which are registered.
|
DockStation[] |
listDockStations()
Gets an array containing all known
DockStations. |
DockStation[] |
listRoots()
Gets a list of stations which have no parent and are therefore
the roots of the dock-trees.
|
protected void |
register(Dockable dockable)
Registers
dockable, the associated controller will know the titles
of dockable to allow drag and drop operations.Clients and subclasses should not call this method. |
protected void |
register(DockStation station,
boolean requiresListener)
Registers
station, the associated controller will support
drag and drop for station.Clients and subclasses should not call this method. |
void |
remove(DockStation station)
Removes a station which was managed by this register.
|
void |
removeDockRegisterListener(DockRegisterListener listener)
Removes a listener from this register.
|
void |
setProtected(DockStation station,
boolean protect)
Marks
station as protected. |
void |
setStalled(boolean stalled)
Sets whether the listener to all
DockStation should forward changes
of the tree to the un-/register-methods or not. |
protected void |
unregister(Dockable dockable)
Unregisters
dockable, the associated controller will no longer
support drag and drop for dockable.Clients and subclasses should not call this method. |
protected void |
unregister(DockStation station)
Unregisters
station, the associated controller will no longer
support drag and drop operations for station.Clients and subclasses should not call this method. |
boolean |
willBeRegistered(Dockable dockable)
Tells whether
dockable will be registered after the currently
stalled events have been fired. |
public DockRegister(DockController controller)
controller - the controller for which the dockables and stations
are stored.public DockController getController()
public void addDockRegisterListener(DockRegisterListener listener)
Dockable or a DockStation is added or removed from
this register.listener - the new listenerpublic void removeDockRegisterListener(DockRegisterListener listener)
listener - the listener to removeaddDockRegisterListener(DockRegisterListener)public void kill()
public void setProtected(DockStation station, boolean protect)
station as protected. Any DockStation can be protected, a protected DockStation
will never be automatically unregistered due to loosing its parent. Instead of unregistering, a protected
station is promoted to root-station. This property is only stored for DockStations which
are already registered, it will be deleted if station is removed.station - the station to protectprotect - the new protection statepublic boolean isProtected(DockStation station)
station is protected.station - the station to searchsetProtected(DockStation, boolean)public void add(DockStation station)
station. If
the children of station are stations itself, then
they will be added automaticallystation - the new stationpublic void remove(DockStation station)
station - the station to removepublic int getStationCount()
add(DockStation)public DockStation getStation(int index)
index - the locationpublic DockStation[] listDockStations()
DockStations.public DockStation[] listRoots()
public int getDockableCount()
DockRegister.public Dockable getDockable(int index)
Dockable that is registered at this DockRegister.index - the location of the Dockablepublic boolean isRegistered(Dockable dockable)
dockable is known to this register.dockable - the dockable to searchtrue if dockable was foundpublic boolean willBeRegistered(Dockable dockable)
dockable will be registered after the currently
stalled events have been fired. The result of this method may change with any
new stalled event. Returns the same result as isRegistered(Dockable) if there are no stalled
events waiting.dockable - the element to searchdockable will be known to this registerpublic Dockable[] listDockables()
protected void register(Dockable dockable)
dockable, the associated controller will know the titles
of dockable to allow drag and drop operations.dockable - a new Dockableprotected void unregister(Dockable dockable)
dockable, the associated controller will no longer
support drag and drop for dockable.dockable - the element to removeprotected void register(DockStation station, boolean requiresListener)
station, the associated controller will support
drag and drop for station.station - the station to addrequiresListener - if true, then the DockStationListener of this
DockRegister will be added to station, if false the
listener will not be addedprotected void unregister(DockStation station)
station, the associated controller will no longer
support drag and drop operations for station.station - the station to removeprotected DockRegisterListener[] listDockRegisterListeners()
protected void fireDockableRegistering(Dockable dockable)
Dockable will be registered.dockable - the Dockable which will be registeredprotected void fireDockableRegistered(Dockable dockable)
Dockable has been registered.dockable - the registered Dockableprotected void fireDockableUnregistered(Dockable dockable)
Dockable has been
unregistered.dockable - the unregistered Dockableprotected void fireDockStationRegistering(DockStation station)
station will be registered.station - the new stationprotected void fireDockStationRegistered(DockStation station)
station has been registered.station - the new stationprotected void fireDockStationUnregistered(DockStation station)
station has been unregistered.station - the unregistered stationprotected void fireStalledChange(Dockable dockable)
dockable cycled
the register.dockable - the cycling elementprotected void fireStalled()
DockRegisterListener that this DockRegister is
stalled.protected void fireUnstalled()
DockRegisterListeners that this DockRegister is
no longer stalled.public void setStalled(boolean stalled)
DockStation should forward changes
of the tree to the un-/register-methods or not. If the
register was stalled and now the argument is false, then
all pending events will be handled immediately.setStalled was
called two times with true, then the events will be fired only
after setStalled was called twice with false.stalled - true if events should be stalled, false
if all pending events should be handled and new events should be handled
immediatelypublic boolean isStalled()
true if stalledCopyright © 2017 Docking Frames. All rights reserved.