private SimpleWindowState restoreWindowState ( ) { SimpleWindowState laststate = null ; final String statestr = preferences . get ( prefnzPrefix + PREF_WINDOW_STATE , null ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "Restoring preference " + PREF_WINDOW_STATE + "=" + statestr ) ; if ( statestr != null ) { SimpleWindowState state = null ; try { state = SimpleWindowState . valueOf ( statestr ) ; } catch ( final IllegalArgumentException e ) { state = null ; } if ( state != null ) { switch ( state ) { case ICONFIED : this . setExtendedState ( Frame . ICONIFIED ) ; break ; case NORMAL : this . setExtendedState ( Frame . NORMAL ) ; break ; case MAXIMIZED : this . setExtendedState ( Frame . MAXIMIZED_BOTH ) ; break ; default : logger . error ( "Invalid window state (nothing will changed): " + statestr ) ; } } laststate = state ; } return laststate ; }
Loads and sets the last window state of the frame . Additionally the last state will be returned .