bibliothek.gui.dock.perspective
Class PredefinedPerspective

java.lang.Object
  extended by bibliothek.gui.dock.perspective.Perspective
      extended by bibliothek.gui.dock.perspective.PredefinedPerspective

public abstract class PredefinedPerspective
extends Perspective

A Perspective that works together with PredefinedDockSituation. These perspectives cannot be created directly, clients need to call PredefinedDockSituation.createPerspective() to obtain an instance.
Clients need to call put(String, PerspectiveElement) in order to register the PerspectiveElements that are "predefined".

Author:
Benjamin Sigg

Constructor Summary
PredefinedPerspective(PredefinedDockSituation situation)
          Creates a new perspective using situation to read and write elements.
 
Method Summary
 String get(PerspectiveElement element)
          Gets the key for element.
 PerspectiveElement get(String key)
          Gets the element which was stored using key.
 String[] getKeys()
          Gets all the keys known to this perspective.
 void put(PredefinedMap map)
          Adds an additional set of items to this perspective.
 void put(String key, PerspectiveElement element)
          Registers element on this PredefinedPerspective.
 
Methods inherited from class bibliothek.gui.dock.perspective.Perspective
convert, convert, getFactory, getID, getSituation, read, readXML, write, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PredefinedPerspective

public PredefinedPerspective(PredefinedDockSituation situation)
Creates a new perspective using situation to read and write elements.

Parameters:
situation - the set of factories to use
Method Detail

put

public void put(PredefinedMap map)
Adds an additional set of items to this perspective.

Parameters:
map - the set of known items, not null

put

public void put(String key,
                PerspectiveElement element)
Registers element on this PredefinedPerspective. When writing the layout the identifier key will be written instead of element.

Parameters:
key - the key of the element
element - the new element

getKeys

public String[] getKeys()
Gets all the keys known to this perspective.

Returns:
all the keys

get

public String get(PerspectiveElement element)
Gets the key for element.

Parameters:
element - some element whose key is searched, not null
Returns:
the key or null

get

public PerspectiveElement get(String key)
Gets the element which was stored using key.

Parameters:
key - the key of some element
Returns:
the element or null