org.grinvin.workspace

Class DefaultWindowWrapper<W,extends,Window>

Implemented Interfaces:
Wrapper<C>
Known Direct Subclasses:
ConjecturingWindowWrapper, EditorWindowWrapper, EditorWindowWrapper_1_0, GraphBrowserWindowWrapper, GrinvinWindowWrapper, GrinvinWindowWrapper_1_0, LoggingWindowWrapper, LoggingWindowWrapper_1_0, WorksheetWindowWrapper

public abstract class DefaultWindowWrapper<W,extends,Window>
extends java.lang.Object
implements Wrapper<C>

Common super class of all wrappers that manage a single window of type W.

Method Summary

protected Element
baseElement()
Create a JDOM-element that contains the version information.
abstract W
create()
Create the subcomponent(s) managed by this wrapper.
void
dispose(W window)
This implementation disposes of the associated window.
W
load(Element element, SectionLoader sloader)
This implementation creates the window using create() and sets window bounds and visibility from the information in the workspace XML-file.
protected static void
loadWindowProperties(Element element, Window window)
General purpose routine which can be used to set bounds and visbility of any window.
void
save(W window, Element parent, SectionSaver ssaver)
This implementation saves the information obtained from the method baseElement() and saveWindowProperties(Element,Window) into parent and leaves the directory alone.
protected static void
saveWindowProperties(Element element, Window window)
General purpose routine which can be used to save the bounds and visibility of any window.

Method Details

baseElement

protected final Element baseElement()
Create a JDOM-element that contains the version information. Further attributes and contents should be added later.

create

public abstract W create()
Create the subcomponent(s) managed by this wrapper. This is typically called when the system is started with no persisted workspace available.
Specified by:
create in interface Wrapper<C>
Returns:
the newly created subcomponent

dispose

public void dispose(W window)
This implementation disposes of the associated window.

load

public W load(Element element,
              SectionLoader sloader)
            throws IOException
This implementation creates the window using create() and sets window bounds and visibility from the information in the workspace XML-file.
Specified by:
load in interface Wrapper<C>

loadWindowProperties

protected static void loadWindowProperties(Element element,
                                           Window window)
            throws IOFormatException
General purpose routine which can be used to set bounds and visbility of any window.

save

public void save(W window,
                 Element parent,
                 SectionSaver ssaver)
            throws IOException
This implementation saves the information obtained from the method baseElement() and saveWindowProperties(Element,Window) into parent and leaves the directory alone.

saveWindowProperties

protected static void saveWindowProperties(Element element,
                                           Window window)
General purpose routine which can be used to save the bounds and visibility of any window.