|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.frontend.DefaultFrontendPerspectiveCache
public class DefaultFrontendPerspectiveCache
This default implementation of a FrontendPerspectiveCache
assumes that the information clients
gave to a DockFrontend
is enough and use only the default PerspectiveElement
s. This cache
handles only the default implementation of the DockStation
s and of DefaultDockable
. Using any
other DockElement
will result in exceptions.
DefaultDockable
s are represented by FrontendDockablePerspective
s.
This implementation has several drawbacks:
PerspectiveElement
that were ever created are stored in a cache. Clients should make sure to
use a new cache everytime the access a Perspective
, this way the old cache can be cleaned up by the
garbage collector.Dockable
s is read from the DockFrontend
, this cache has no way
to know the identifiers of unregistered elements. These elements will be ignored and thrown away when reading the layout.
Constructor Summary | |
---|---|
DefaultFrontendPerspectiveCache(DockFrontend frontend)
Creates a new cache |
Method Summary | |
---|---|
java.lang.String |
get(PerspectiveElement element)
Gets the unique identifier of element . |
PerspectiveElement |
get(java.lang.String id,
boolean rootStation)
Called to convert id to a PerspectiveElement . |
PerspectiveElement |
get(java.lang.String id,
DockElement element,
boolean isRootStation)
Given an element that was earlier created by the client and added to a
DockFrontend , this method converts element to a PerspectiveElement . |
boolean |
isRootStation(PerspectiveStation station)
Tells whether station is supposed to be a root-station. |
protected void |
put(PerspectiveElement element,
java.lang.String id)
Makes an association that the identifier id is used for element . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultFrontendPerspectiveCache(DockFrontend frontend)
frontend
- the frontend to query for information about DockElement
s.Method Detail |
---|
public PerspectiveElement get(java.lang.String id, DockElement element, boolean isRootStation)
FrontendPerspectiveCache
element
that was earlier created by the client and added to a
DockFrontend
, this method converts element
to a PerspectiveElement
.
get
in interface FrontendPerspectiveCache
id
- the unique identifier under which element
is known to the DockFrontend
element
- the element whose perspective must be createdisRootStation
- whether element
is registered as root-station at the DockFrontend
or as Dockable
null
protected void put(PerspectiveElement element, java.lang.String id)
id
is used for element
.
element
- the element whose identifier is stored, not null
id
- the identifier to store, not null
public PerspectiveElement get(java.lang.String id, boolean rootStation)
FrontendPerspectiveCache
id
to a PerspectiveElement
. This method will only be called
with identifiers that were not used for FrontendPerspectiveCache.get(String, DockElement, boolean)
.
get
in interface FrontendPerspectiveCache
id
- the identifier of some elementrootStation
- whether id
represents a root-station or not
null
public java.lang.String get(PerspectiveElement element)
FrontendPerspectiveCache
element
.
get
in interface FrontendPerspectiveCache
element
- some element, can be either a dockable or a root-station
null
if this cache is unable to associate element
with an identifier. Should not be null
for elements that were created by
FrontendPerspectiveCache.get(String, boolean)
or FrontendPerspectiveCache.get(String, DockElement, boolean)
.public boolean isRootStation(PerspectiveStation station)
FrontendPerspectiveCache
station
is supposed to be a root-station.
isRootStation
in interface FrontendPerspectiveCache
station
- the element which may be a root-station
true
if station
should be treated as root-station
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |