Package fr.ifremer.isisfish.ui.widget
Class SwingSession
java.lang.Object
fr.ifremer.isisfish.ui.widget.SwingSession
Use to store and restore position and size of application. Supported widgets
are:
- java.awt.Window (and subclasses)
- javax.swing.JTabbedPane (and subclasses)
- javax.swing.JSplitPane (and subclasses)
- javax.swing.JTable (and subclasses)
- create SwingSession object
- add component that you want save
- explicit call to save
- Author:
- poussin
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static class
State for JSplit FIXME add listener for divider move actionstatic class
State for JTabbedPanestatic class
State for JTable.static class
static class
static interface
get(save) and set(restore) state of object passed in argumentstatic class
State for Window -
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected File
protected LinkedHashSet<Component>
protected Map<Class,
SwingSession.State> State object registered to get and set State.protected Map<String,
SwingSession.State> state of all component added with add method. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
finalize()
protected String
getStateManager
(Class clazz) loadStates
(File file) Loads the states from the filevoid
Remove component from component to savevoid
save()
void
setStates
(String path, SwingSession.State state) void
protected void
walkThrowComponent
(String path, Collection<Component> roots, SwingSession.Action action)
-
Field Details
-
file
-
autoSave
protected boolean autoSave -
registeredComponent
-
stateManager
State object registered to get and set State. key: class of component managed by the state; value: the state -
states
state of all component added with add method. key: path of component; value: State
-
-
Constructor Details
-
SwingSession
-
-
Method Details
-
finalize
-
save
public void save() -
loadStates
Loads the states from the file -
updateState
public void updateState() -
add
-
remove
Remove component from component to save- Parameters:
c
-
-
getComponentName
-
getStateManager
-
getStates
-
setStates
-
walkThrowComponent
protected void walkThrowComponent(String path, Collection<Component> roots, SwingSession.Action action)
-