Class WindowProperty
- All Implemented Interfaces:
PropertySupport
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 aWindowStateobject forWindow c.voidsetSessionState(Component c, Object state) Restore theWindow'sbounds if the dimensions of its screen (GraphicsConfiguration) haven't changed, the number of screens hasn't changed, and theisLocationByPlatformproperty, which indicates that native Window manager should pick the Window's location, is false.
-
Constructor Details
-
WindowProperty
public WindowProperty()
-
-
Method Details
-
getSessionState
Returns aWindowStateobject forWindow c.Throws an
IllegalArgumentExceptionifComponent cisn't a non-nullWindow.- Specified by:
getSessionStatein interfacePropertySupport- Parameters:
c- theWindowwhose bounds will be stored in aWindowStateobject.- Returns:
- the
WindowStateobject - See Also:
-
setSessionState
Restore theWindow'sbounds if the dimensions of its screen (GraphicsConfiguration) haven't changed, the number of screens hasn't changed, and theisLocationByPlatformproperty, which indicates that native Window manager should pick the Window's location, is false. More precisely:If
stateis non-null, and Windowc'sGraphicsConfigurationboundsmatches theWindowState's value, and Windowc'sisLocationByPlatformproperty is false, then set the Window's to thesaved value.Throws an
IllegalArgumentExceptionifcis not aWindowor ifstateis non-null but not an instance ofWindowState.- Specified by:
setSessionStatein interfacePropertySupport- Parameters:
c- the Window whose state is to be restoredstate- theWindowStateto be restored- See Also:
-