org.grinvin.workspace
Class DefaultWindowWrapper<W,extends,Window>
java.lang.Object
org.grinvin.workspace.DefaultWindowWrapper<W,extends,Window>
- Wrapper<C>
public abstract class DefaultWindowWrapper<W,extends,Window>
extends java.lang.Object
Common super class of all wrappers that manage a single window of
type W.
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.
|
int | getMajorVersion() - This format has version 1.0
|
int | getMinorVersion() - This format has version 1.0
|
W | load(Element element, File directory) - 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, File directory) - 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.
|
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.
- create in interface Wrapper<C>
- the newly created subcomponent
dispose
public void dispose(W window)
This implementation disposes of the associated window.
load
public W load(Element element,
File directory)
throws IOException
This implementation creates the window using
create()
and sets window bounds and visibility
from the information in the workspace XML-file.
- 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,
File directory)
throws IOException
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.