|
||||||||||
| 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 PerspectiveElements. This cache
handles only the default implementation of the DockStations and of DefaultDockable. Using any
other DockElement will result in exceptions.
DefaultDockables are represented by FrontendDockablePerspectives.
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.Dockables 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 DockElements.| Method Detail |
|---|
public PerspectiveElement get(java.lang.String id,
DockElement element,
boolean isRootStation)
FrontendPerspectiveCacheelement that was earlier created by the client and added to a
DockFrontend, this method converts element to a PerspectiveElement.
get in interface FrontendPerspectiveCacheid - the unique identifier under which element is known to the DockFrontendelement - 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 nullid - the identifier to store, not null
public PerspectiveElement get(java.lang.String id,
boolean rootStation)
FrontendPerspectiveCacheid to a PerspectiveElement. This method will only be called
with identifiers that were not used for FrontendPerspectiveCache.get(String, DockElement, boolean).
get in interface FrontendPerspectiveCacheid - the identifier of some elementrootStation - whether id represents a root-station or not
nullpublic java.lang.String get(PerspectiveElement element)
FrontendPerspectiveCacheelement.
get in interface FrontendPerspectiveCacheelement - 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)
FrontendPerspectiveCachestation is supposed to be a root-station.
isRootStation in interface FrontendPerspectiveCachestation - 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 | |||||||||