Package com.xinapse.image
Class PreviewIcon
java.lang.Object
com.xinapse.image.PreviewIcon
- All Implemented Interfaces:
Icon
An Icon that is used to preview an image (UNC, Analyze, NIFTI, DICOM).
-
Constructor Summary
ConstructorDescriptionPreviewIcon
(String imageTypeString, int nCols, int nRows, int nSlices, int nFrames) Create a PreviewIcon without a preview of the image.PreviewIcon
(String imageTypeString, ReadableImage image) Create a PreviewIcon with a preview of the image. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the icon's width.int
Returns the icon's height.static Dimension
Returns the icon's preferred size.void
Draw the icon at the specified location.
-
Constructor Details
-
PreviewIcon
Create a PreviewIcon without a preview of the image.- Parameters:
imageTypeString
- a String describing the image type (e.g., "UNC").nCols
- the number of image columns.nRows
- the number of image rows.nSlices
- the number of image slice.nFrames
- the number of image frames.
-
PreviewIcon
Create a PreviewIcon with a preview of the image.- Parameters:
imageTypeString
- a String describing the image type (e.g., "UNC").image
- the image to preview.
-
-
Method Details
-
getIconWidth
public int getIconWidth()Returns the icon's height.- Specified by:
getIconWidth
in interfaceIcon
-
getIconHeight
public int getIconHeight()Returns the icon's width.- Specified by:
getIconHeight
in interfaceIcon
-
getPreferredSize
Returns the icon's preferred size.- Returns:
- the icon's preferred size.
-
paintIcon
Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.
-