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
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classState for JSplit FIXME add listener for divider move actionstatic classState for JTabbedPanestatic classState for JTable.static classstatic classstatic interfaceget(save) and set(restore) state of object passed in argumentstatic classState for Window -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Fileprotected 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidfinalize()protected StringgetStateManager(Class clazz) loadStates(File file) Loads the states from the filevoidRemove component from component to savevoidsave()voidsetStates(String path, SwingSession.State state) voidprotected voidwalkThrowComponent(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)
-