int exportHeight = dlg.getImgHeight();
Collection selection = view.getSelection();
if ( selection != null ) {
if ( selection.size() > 1 ) {
// Ensure that the numbering order is the same is in current view
PhotoInfo exportPhotos[]
= (PhotoInfo[]) selection.toArray( new PhotoInfo[selection.size() ]);
Comparator comp = view.getPhotoOrderComparator();
if ( comp != null ) {
Arrays.sort( exportPhotos, comp );
}
String format = getSequenceFnameFormat( exportFileTmpl );
BrowserWindow w = null;
ExportThread exporter = new ExportThread( this, exportPhotos,
format, exportWidth, exportHeight );
Thread t = new Thread( exporter );
setEnabled( false );
t.start();
} else {
Iterator iter = selection.iterator();
if ( iter.hasNext() ) {
PhotoInfo photo = (PhotoInfo) iter.next();
try {
photo.exportPhoto( new File( exportFileTmpl ),
exportWidth, exportHeight );
} catch (PhotovaultException ex) {
JOptionPane.showMessageDialog( view.getRootPane(),
ex.getMessage(),
"Error exporting image",