previewFrame.displayPicture( currentAlbum.getPicture( sel ) );
previewFrame.displayPicture( currentAlbum.getPicture( sel ), true);
	void resetUIState() {		SwingUtilities.invokeLater(new Runnable() {			public void run() {				Album currentAlbum = getCurrentAlbum();				Gallery currentGallery = getCurrentGallery();				// if the list is empty or comm, disable upload				jUploadButton.setEnabled( currentAlbum != null						&& currentAlbum.sizePictures() > 0						&& !inProgress						&& jAlbumTree.getSelectionCount() > 0 );				jSortButton.setEnabled(jUploadButton.isEnabled());				if (null == m_lastOpenedFile) {					setTitle(DIALOGTITLE							+ GRI18n.getString(MODULE, "noTitleHeader")							+ (m_isDirty ? "*" : ""));				} else {					setTitle(DIALOGTITLE							+ m_lastOpenedFile.getName()							+ (m_isDirty ? "*" : ""));				}				// during comm, don't change Gallery or do any other comm				jLoginButton.setEnabled( !inProgress && currentGallery != null);				jGalleryCombo.setEnabled( !inProgress );				jNewGalleryButton.setEnabled( !inProgress );                // Disable New, Open, and Close                jMenuItemNew.setEnabled( !inProgress );                jMenuItemOpen.setEnabled( !inProgress );                jMenuItemSave.setEnabled( !inProgress );                jMenuItemSaveAs.setEnabled( !inProgress );				jMenuItemClose.setEnabled( !inProgress						&& null != m_lastOpenedFile );                // in the event the library we use to save is missing, dim the menus                try {                    new JSX.ObjOut();                } catch (Throwable t) {                    jMenuItemOpen.setEnabled(false);                    jMenuItemSave.setEnabled(false);                    jMenuItemSaveAs.setEnabled(false);                }				if (currentGallery != null						&& currentGallery.getUsername() != null						&& currentGallery.hasComm()						&& currentGallery.getComm(jStatusBar).isLoggedIn()) {					jLoginButton.setText(GRI18n.getString(MODULE, "Log_out"));				} else {					jLoginButton.setText(GRI18n.getString(MODULE, "Log_in"));				}				jAlbumTree.setEnabled( ! inProgress && jAlbumTree.getModel().getChildCount(jAlbumTree.getModel().getRoot()) >= 1);				// if the selected album is uploading, disable everything				boolean enabled = ! inProgress && currentAlbum != null && jAlbumTree.getModel().getChildCount(jAlbumTree.getModel().getRoot()) >= 1;				jBrowseButton.setEnabled( enabled && currentAlbum.getCanAdd());				jPictureInspector.setEnabled( enabled );				jPicturesList.setEnabled( enabled && currentAlbum.getCanAdd());				jNewAlbumButton.setEnabled( !inProgress && currentGallery != null && currentGallery.hasComm()					&& currentGallery.getComm(jStatusBar).hasCapability(GalleryCommCapabilities.CAPA_NEW_ALBUM));				// change image displayed				int sel = jPicturesList.getSelectedIndex();				if (currentAlbum != null && currentAlbum.getSize() < 1) {					// if album was just emptied, it takes a while for the pictureList					// to notice...					// this is fixed by using invokeLater [apparently not anymore]					sel = -1;				}				if ( GalleryRemote.getInstance().properties.getShowPreview() && previewFrame != null ) {					if ( sel != -1 ) {						previewFrame.displayPicture( currentAlbum.getPicture( sel ) );					} else {						previewFrame.displayPicture( null );					}					if ( !previewFrame.isVisible() ) {						previewFrame.setVisible( true );					}				}				// status				if ( currentAlbum == null) {					jPictureInspector.setPictures( null );					jStatusBar.setStatus(GRI18n.getString(MODULE, "notLogged") );				} else if ( currentAlbum.sizePictures() > 0 ) {					jPictureInspector.setPictures( jPicturesList.getSelectedValues() );					int selN = jPicturesList.getSelectedIndices().length;					if ( sel == -1 ) {						Object [] params = {new Integer(currentAlbum.sizePictures()),											new Integer((int)(currentAlbum.getPictureFileSize() / 1024))};						jStatusBar.setStatus(GRI18n.getString(MODULE, "statusBarNoSel", params ));					} else {						Object [] params = {new Integer(selN),											GRI18n.getString(MODULE, (selN==1)?"oneSel":"manySel"),											new Integer((int) Album.getObjectFileSize( jPicturesList.getSelectedValues() ) / 1024 )};						jStatusBar.setStatus(GRI18n.getString(MODULE, "statusBarSel", params));					}				} else {					jPictureInspector.setPictures( null );					jStatusBar.setStatus(GRI18n.getString(MODULE, "noSelection"));				}				jAlbumInspector.setAlbum(currentAlbum);				jAlbumTree.repaint();			}});	}