Class SessionStorage.WindowProperty
- All Implemented Interfaces:
SessionStorage.Property
- Enclosing class:
SessionStorage
sessionState
property for Window.
This class defines how the session state for Windows
is saved
and
and restored
in
terms of a property called sessionState
. The
Window's bounds Rectangle
is saved and restored
if the dimensions of the Window's screen have not changed.
WindowProperty
is registered for Window.class
by
default, so this class applies to the AWT Window
,
Dialog
, and Frame
class, as well as their
Swing counterparts: JWindow
, JDialog
, and
JFrame
.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns aWindowState
object forWindow c
.void
setSessionState
(Component c, Object state) Restore theWindow's
bounds if the dimensions of its screen (GraphicsConfiguration
) haven't changed, the number of screens hasn't changed, and theisLocationByPlatform
property, which indicates that native Window manager should pick the Window's location, is false.
-
Constructor Details
-
WindowProperty
public WindowProperty()
-
-
Method Details
-
getSessionState
Returns aWindowState
object forWindow c
.Throws an
IllegalArgumentException
ifComponent c
isn't a non-nullWindow
.- Specified by:
getSessionState
in interfaceSessionStorage.Property
- Parameters:
c
- theWindow
whose bounds will be stored in aWindowState
object.- Returns:
- the
WindowState
object - See Also:
-
setSessionState
Restore theWindow's
bounds if the dimensions of its screen (GraphicsConfiguration
) haven't changed, the number of screens hasn't changed, and theisLocationByPlatform
property, which indicates that native Window manager should pick the Window's location, is false. More precisely:If
state
is non-null, and Windowc's
GraphicsConfiguration
bounds
matches theWindowState's value
, and Windowc's
isLocationByPlatform
property is false, then set the Window's to thesaved value
.Throws an
IllegalArgumentException
ifc
is not aWindow
or ifstate
is non-null but not an instance ofSessionStorage.WindowState
.- Specified by:
setSessionState
in interfaceSessionStorage.Property
- Parameters:
c
- the Window whose state is to be restoredstate
- theWindowState
to be restored- See Also:
-