|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
D
- the kind of DockElement
this converter handlesL
- the kind of data this converter uses as intermediate formatpublic interface DockConverter<D extends DockElement,L>
A DockConverter
can store or load content which is related
to a certain kind of DockElement
.
The content of an element is first converted in a special intermediate form
represented by some object of type L
. This intermediate object
can then be written as byte-stream or in xml.
Method Summary | |
---|---|
String |
getID()
Gets the unique name of this converter. |
L |
getLayout(D element,
Map<Dockable,Integer> children)
Gets the layout of element . |
L |
read(DataInputStream in)
Reads a layout from a stream. |
L |
read(XElement element)
Reads a layout from an xml-element. |
void |
setLayout(D element,
L layout)
Reads the contents of layout and changes the layout of
element accordingly. |
void |
setLayout(D element,
L layout,
Map<Integer,Dockable> children)
Reads the contents of layout and changes the layout of
element accordingly. |
void |
write(L layout,
DataOutputStream out)
Writes the contents of layout into out . |
void |
write(L layout,
XElement element)
Writes the contents of layout into element . |
Method Detail |
---|
String getID()
L getLayout(D element, Map<Dockable,Integer> children)
element
. This method should create
a new instance of the layout object, that new object should not be
tied to element
in any way. A layout can be living for
a long period of time and might be used on another dockable
object.
element
- the element for which a new layout should be createdchildren
- a map containing unique identifiers for the children
of the element. Children which are not in this map should not be
stored in the layout.
void setLayout(D element, L layout, Map<Integer,Dockable> children)
layout
and changes the layout of
element
accordingly. This method should remove all
children from element
and add new children.
element
- the element whose content and children will be rearranged.layout
- the new layout of element
children
- some children, note that the map may not contain all elements
which were present when the layout was created.void setLayout(D element, L layout)
layout
and changes the layout of
element
accordingly. This method should not add or remove
children to or from element
.
element
- the element whose properties will be changedlayout
- the new set of propertiesvoid write(L layout, DataOutputStream out) throws IOException
layout
into out
.
layout
- the layout to storeout
- the stream to write into
IOException
- if an I/O-error occursvoid write(L layout, XElement element)
layout
into element
.
layout
- the layout to storeelement
- an xml-element into which this method should write, the
attributes of element
should not be changed.L read(DataInputStream in) throws IOException
in
- the stream to read from
null
if the layout
should be discarded
IOException
- if an I/O-error occursL read(XElement element)
element
- the element to read, should not be changed by this
method.
null
if the layout
should be discarded
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |