|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.DockHierarchyLock
public class DockHierarchyLock
The DockHierarchyLock
allows DockStation
s to defend
themselfs against concurrent modifications of the hierarchy. At any time only
one DockStation
in the realm of a DockController
can acquire
the lock.
Nested Class Summary | |
---|---|
static class |
DockHierarchyLock.Token
Is acquired from a DockHierarchyLock and releases the lock. |
Constructor Summary | |
---|---|
DockHierarchyLock()
|
Method Summary | |
---|---|
static DockHierarchyLock.Token |
acquireFake()
Acquires a fake token which does not lock anything. |
DockHierarchyLock.Token |
acquireLink(DockStation station,
Dockable dockable)
Allows station to become the new parent of dockable . |
static DockHierarchyLock.Token |
acquireLinking(DockStation station,
Dockable dockable)
The same as calling acquireLink(DockStation, Dockable) with the DockHierarchyLock of
the DockController of station . |
DockHierarchyLock.Token |
acquireUnlink(DockStation station,
Dockable dockable)
Allows station to remove itself as parent from dockable . |
static DockHierarchyLock.Token |
acquireUnlinking(DockStation station,
Dockable dockable)
The same as calling acquireUnlink(DockStation, Dockable) with the DockHierarchyLock of
the DockController of station . |
boolean |
isConcurrent()
Whether this lock throws exceptions or is silent. |
boolean |
isHardExceptions()
Tells whether hard exceptions should be thrown or only printed. |
void |
setConcurrent(boolean concurrent)
Tells this lock whether concurrent modifications are allowed or not. |
void |
setHardExceptions(boolean hardExceptions)
Sets whether exceptions should be thrown or only printed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DockHierarchyLock()
Method Detail |
---|
public void setHardExceptions(boolean hardExceptions)
hardExceptions
- true
if the exceptions should be thrownpublic boolean isHardExceptions()
true
if exceptions should be thrownsetHardExceptions(boolean)
public void setConcurrent(boolean concurrent)
concurrent
- whether to allow concurrent modification or notpublic boolean isConcurrent()
true
, then this lock is silentisConcurrent()
public static DockHierarchyLock.Token acquireLinking(DockStation station, Dockable dockable)
acquireLink(DockStation, Dockable)
with the DockHierarchyLock
of
the DockController
of station
. Returns a fake DockHierarchyLock.Token
if station
has
no DockController
.
station
- the station which wants to be the new parent of dockable
dockable
- a dockable with no parent
IllegalStateException
- if dockable
has a parent or station
thinks that dockable
is one of its childrenpublic static DockHierarchyLock.Token acquireUnlinking(DockStation station, Dockable dockable)
acquireUnlink(DockStation, Dockable)
with the DockHierarchyLock
of
the DockController
of station
. Returns a fake DockHierarchyLock.Token
if station
has
no DockController
.
station
- the current parent of dockable
dockable
- a dockable with station
as parent
IllegalStateException
- if dockable
is not a child of
station
public static DockHierarchyLock.Token acquireFake()
public DockHierarchyLock.Token acquireLink(DockStation station, Dockable dockable)
station
to become the new parent of dockable
.
station
- the station which wants to be the new parent of dockable
dockable
- a dockable with no parent
IllegalStateException
- if dockable
has a parent or station
thinks that dockable
is one of its childrenpublic DockHierarchyLock.Token acquireUnlink(DockStation station, Dockable dockable)
station
to remove itself as parent from dockable
.
station
- the current parent of dockable
dockable
- a dockable with station
as parent
IllegalStateException
- if dockable
is not a child of
station
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |