Issue #3767 Change default image export name to screenCapture.png.

Former-commit-id: baa1fc1f7f [formerly 4e24cde257] [formerly 1591c9cbb8] [formerly baa1fc1f7f [formerly 4e24cde257] [formerly 1591c9cbb8] [formerly 80c209fef7 [formerly 1591c9cbb8 [formerly 021367d3212e185a2d8d4e5970fc268204bf070b]]]]
Former-commit-id: 80c209fef7
Former-commit-id: 0476884815 [formerly 89194b9816] [formerly 99f53b8aeb02e9794b90d3491a2455d6323c9259 [formerly 14dbd71e9d]]
Former-commit-id: fd2a838bcdafc89a7491a17dc63a52397be2a464 [formerly 101c92c99c]
Former-commit-id: e74823bc2d
This commit is contained in:
Ben Steffensmeier 2014-10-28 11:21:17 -05:00
parent fca79dd44e
commit 36df1e299b
2 changed files with 20 additions and 7 deletions

View file

@ -54,6 +54,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* ------------- -------- ----------- --------------------------
* Jan 20, 2014 2312 bsteffen Initial creation
* Mar 10, 2014 2867 bsteffen Better frame range validation.
* Oct 28, 2014 3767 bsteffen Automatically change filename if selected
* format does not support all options.
*
* </pre>
*
@ -412,13 +414,23 @@ public class ImageExportDialog extends CaveSWTDialog {
}
}
if (!goodSuffix) {
MessageBox mb = new MessageBox(getShell(), SWT.ICON_ERROR | SWT.OK);
mb.setText("Invalid Suffix");
mb.setMessage("The file extension(" + suffix
MessageBox mb = new MessageBox(getShell(), SWT.ICON_WARNING
| SWT.YES | SWT.NO);
mb.setText("Incompatible Format");
ImageFormat format = options.getImageFormat();
mb.setMessage("The format(" + suffix
+ ") of the selected file is not valid for "
+ options.getImageFormat().getDescription());
mb.open();
return false;
+ format.getDescription()
+ ". Would you like to continue and export the file in "
+ format.getExtensions()[0] + " format?");
int result = mb.open();
if (result == SWT.YES) {
suffix = format.getExtensions()[0];
path = path.substring(0, path.lastIndexOf('.') + 1) + suffix;
options.setFileLocation(new File(path));
} else {
return false;
}
}
File file = options.getFileLocation();

View file

@ -37,6 +37,7 @@ import com.raytheon.uf.viz.core.datastructure.LoopProperties;
* ------------- -------- ----------- --------------------------
* Jan 20, 2014 2312 bsteffen Initial creation
* Mar 10, 2014 2867 bsteffen Better frame range validation.
* Oct 28, 2014 3767 bsteffen Change default name to screenCapture.png
*
* </pre>
*
@ -79,7 +80,7 @@ public class ImageExportOptions {
}
private File fileLocation = new File("screenCapture.gif");
private File fileLocation = new File("screenCapture.png");
private ImageFormat imageFormat = ImageFormat.SEQUENCE;