Class PreviewIcon

java.lang.Object
com.xinapse.image.PreviewIcon
All Implemented Interfaces:
Icon

public class PreviewIcon extends Object implements Icon
An Icon that is used to preview an image (UNC, Analyze, NIFTI, DICOM).
  • Constructor Details

    • PreviewIcon

      public PreviewIcon(String imageTypeString, int nCols, int nRows, int nSlices, int nFrames)
      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

      public PreviewIcon(String imageTypeString, ReadableImage image)
      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 interface Icon
    • getIconHeight

      public int getIconHeight()
      Returns the icon's width.
      Specified by:
      getIconHeight in interface Icon
    • getPreferredSize

      public static Dimension getPreferredSize()
      Returns the icon's preferred size.
      Returns:
      the icon's preferred size.
    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y)
      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.
      Specified by:
      paintIcon in interface Icon