|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.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 DockStation
s or Dockable
s.
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 DockFactory s that are registered at
this perspective. |
DockLayoutComposition |
convert(PerspectiveElement element)
Converts element using the DockFactory s 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 PerspectiveElement s
and DockLayoutComposition s. |
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 useMethod 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 intopublic 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 ocurrspublic 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 DockFactory
s 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 DockFactory
s that are registered at
this perspective.
composition
- the element to convert, not null
public DockSituation getSituation()
DockSituation
which is used to convert PerspectiveElement
s
and DockLayoutComposition
s.
null
protected abstract String getID(PerspectiveElement element)
element
.
element
- the element to store
element
protected 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 |