private Dimension restoreWindowSize ( ) { Dimension result = null ; final String sizestr = preferences . get ( prefnzPrefix + PREF_WINDOW_SIZE , null ) ; if ( sizestr != null ) { int width = 0 ; int height = 0 ; final String [ ] sizes = sizestr . split ( "[,]" ) ; try { width = Integer . parseInt ( sizes [ 0 ] . trim ( ) ) ; height = Integer . parseInt ( sizes [ 1 ] . trim ( ) ) ; } catch ( final Exception e ) { // ignoring, cause is prevented by default values; } if ( width > 0 && height > 0 ) { result = new Dimension ( width , height ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "Restoring preference " + PREF_WINDOW_SIZE + "=" + result . width + "," + result . height ) ; this . setSize ( result ) ; } } return result ; }
Loads and set the saved size preferences for this frame .