Package xal.tools.apputils
Class ImageCaptureManager
java.lang.Object
xal.tools.apputils.ImageCaptureManager
ImageCaptureManager manages the file chooser used to save image captures of
the main window. All applications share the same default folder where the
images are saved. This default folder is the last folder where a user saved
an image.
- Author:
- tap
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DefaultFolderAccessory
accessory for managing the default snapshot folderprotected final JFileChooser
chooser for saving imagesprotected static final int
protected static final int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new instance of ImageCaptureManager -
Method Summary
Modifier and TypeMethodDescriptionstatic ImageCaptureManager
Get the default ImageCaptureManager instance.static int
displayConfirmDialog
(Component owner, String title, String message) Display a confirmation dialog with a title and messageGet the file chooser which determines where snapshots are saved.void
saveSnapshot
(Component component) Save a snapshot of the component as a PNG image.void
saveSnapshot
(Component component, String name) Save a snapshot of the component as a PNG image.
-
Field Details
-
YES_OPTION
protected static final int YES_OPTION- See Also:
-
NO_OPTION
protected static final int NO_OPTION- See Also:
-
fileChooser
chooser for saving images -
defaultFolderAccessory
accessory for managing the default snapshot folder
-
-
Constructor Details
-
ImageCaptureManager
protected ImageCaptureManager()Creates a new instance of ImageCaptureManager
-
-
Method Details
-
defaultManager
Get the default ImageCaptureManager instance.- Returns:
- The default ImageCaptureManager instance.
-
getFileChooser
Get the file chooser which determines where snapshots are saved.- Returns:
- the image capture file chooser
-
saveSnapshot
Save a snapshot of the component as a PNG image.- Parameters:
component
- The component to capture.- Throws:
AWTException
- If there is an AWT exception.IOException
- If there is a file exception.
-
saveSnapshot
Save a snapshot of the component as a PNG image.- Parameters:
component
- The component to capture.name
- The snapshot name- Throws:
AWTException
- If there is an AWT exception.IOException
- If there is a file exception.
-
displayConfirmDialog
Display a confirmation dialog with a title and message- Parameters:
owner
- The component in front of which to show the dialogtitle
- The title of the dialogmessage
- The message to display- Returns:
- YES_OPTION or NO_OPTION
-