Class SessionStorage.WindowProperty
- java.lang.Object
-
- org.jdesktop.application.SessionStorage.WindowProperty
-
- All Implemented Interfaces:
SessionStorage.Property
- Enclosing class:
- SessionStorage
public static class SessionStorage.WindowProperty extends java.lang.Object implements SessionStorage.Property
AsessionStateproperty for Window.This class defines how the session state for
Windowsissavedand andrestoredin terms of a property calledsessionState. The Window'sbounds Rectangleis saved and restored if the dimensions of the Window's screen have not changed.WindowPropertyis registered forWindow.classby default, so this class applies to the AWTWindow,Dialog, andFrameclass, as well as their Swing counterparts:JWindow,JDialog, andJFrame.
-
-
Constructor Summary
Constructors Constructor Description WindowProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetSessionState(java.awt.Component c)Returns aWindowStateobject forWindow c.voidsetSessionState(java.awt.Component c, java.lang.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.
-
-
-
Method Detail
-
getSessionState
public java.lang.Object getSessionState(java.awt.Component c)
Returns aWindowStateobject forWindow c.Throws an
IllegalArgumentExceptionifComponent cisn't a non-nullWindow.- Specified by:
getSessionStatein interfaceSessionStorage.Property- Parameters:
c- theWindowwhose bounds will be stored in aWindowStateobject.- Returns:
- the
WindowStateobject - See Also:
setSessionState(java.awt.Component, java.lang.Object),SessionStorage.WindowState
-
setSessionState
public void setSessionState(java.awt.Component c, java.lang.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. 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 ofSessionStorage.WindowState.- Specified by:
setSessionStatein interfaceSessionStorage.Property- Parameters:
c- the Window whose state is to be restoredstate- theWindowStateto be restored- See Also:
getSessionState(java.awt.Component),SessionStorage.WindowState
-
-