|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.perspective.Perspective
public abstract class Perspective
A Perspective is a helper class that allows clients to create a layout without the need to
create DockStations or Dockables.
Perspectives cannot be created directly, clients must first set up the DockSituation that
would load the layout and then call the method DockSituation.createPerspective() to create
a Perspective which in return is able to write a file that matches the need of its
owner DockSituation.
| Constructor Summary | |
|---|---|
Perspective(DockSituation situation)
Creates a new Perspective using situation to read and write
items. |
|
| Method Summary | |
|---|---|
PerspectiveElement |
convert(DockLayoutComposition composition)
Converts composition using the DockFactorys that are registered at
this perspective. |
DockLayoutComposition |
convert(PerspectiveElement element)
Converts element using the DockFactorys that are registered at this
perspective. |
protected abstract DockFactory<?,?,?> |
getFactory(String id)
Gets the factory which is responsible to store an element whose id is id. |
protected abstract String |
getID(PerspectiveElement element)
Gets the identifier of the factory that is responsible for element. |
DockSituation |
getSituation()
Gets the DockSituation which is used to convert PerspectiveElements
and DockLayoutCompositions. |
Map<String,PerspectiveStation> |
read(DataInputStream in)
Reads the contents of in and returns them in a map. |
Map<String,PerspectiveStation> |
readXML(XElement root)
Reads the contents of root and returns them in a map. |
void |
write(Map<String,PerspectiveStation> stations,
DataOutputStream out)
Writes the layout created by stations to out. |
void |
writeXML(Map<String,PerspectiveStation> stations,
XElement element)
Converts the content of stations to XML. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Perspective(DockSituation situation)
Perspective using situation to read and write
items.
situation - the set of factories to use| Method Detail |
|---|
public Map<String,PerspectiveStation> readXML(XElement root)
root and returns them in a map.
root - the data to read
root
public void writeXML(Map<String,PerspectiveStation> stations,
XElement element)
stations to XML.
stations - the items to writeelement - the element to write into
public Map<String,PerspectiveStation> read(DataInputStream in)
throws IOException
in and returns them in a map.
in - the stream to read from
in
IOException - if an I/O-error ocurrs
public void write(Map<String,PerspectiveStation> stations,
DataOutputStream out)
throws IOException
stations to out. The data written
by this method can be read by DockSituation.read(DataInputStream)
stations - the root-stations to storeout - the stream to write into
IOException - if an I/O-error occurredpublic DockLayoutComposition convert(PerspectiveElement element)
element using the DockFactorys that are registered at this
perspective.
element - the element to convert, not null
IllegalArgumentException - if a factory is missingpublic PerspectiveElement convert(DockLayoutComposition composition)
composition using the DockFactorys that are registered at
this perspective.
composition - the element to convert, not null
public DockSituation getSituation()
DockSituation which is used to convert PerspectiveElements
and DockLayoutCompositions.
nullprotected abstract String getID(PerspectiveElement element)
element.
element - the element to store
elementprotected abstract DockFactory<?,?,?> getFactory(String id)
id.
id - the identifier of the element to store or read
null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||