Package repast.simphony.ui.widget
Class SnapshotTaker
java.lang.Object
repast.simphony.ui.widget.SnapshotTaker
Takes a snapshot of a JComponent.
- Author:
- Nick Collier
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ActionCreates an Action that will take a snapshot fo the specified JComponent when triggered.voidSaves the snapshot to the specified file and in the specified format.voidtakeSnapshot(JComponent parent) Takes a snapshot of the Imageable associated with this Snapshot taker.
-
Field Details
-
JPEG
- See Also:
-
JPG
- See Also:
-
TIFF
- See Also:
-
TIF
- See Also:
-
PNG
- See Also:
-
BMP
- See Also:
-
-
Constructor Details
-
SnapshotTaker
-
SnapshotTaker
-
-
Method Details
-
takeSnapshot
Takes a snapshot of the Imageable associated with this Snapshot taker. This will display a file dialog.- Parameters:
parent- the component to center the file dialog over- Throws:
IOException- if there is an error taking the snapshot
-
save
Saves the snapshot to the specified file and in the specified format.- Parameters:
file- the file to save the image toimageFormat- the image format. One of "bmp", "jpg", "tif", or "png".- Throws:
IOException- if there is an error saving the snapshot
-
createSnapshotAction
Creates an Action that will take a snapshot fo the specified JComponent when triggered.- Parameters:
comp- the component to take a snapshot of.- Returns:
- an Action that will take a snapshot fo the specified JComponent when triggered.
-