Class FileImageXML.Thumbnail

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
gov.nih.mipav.model.file.FileImageXML.Thumbnail
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Enclosing class:
FileImageXML

public class FileImageXML.Thumbnail extends JComponent implements Serializable
Holds an AWT Image and an int[] array of data for an XML Thumbnail image the thumbnail is stored in the XML's header so that it may be read in independently from the actual image data. when an XML file is saved, the user has the option to also saved a reduced resolution (max 64x64) image into the XML's header using standard XML tagging
Author:
Ben Link
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • brightness

      private int brightness
      DOCUMENT ME!
    • contrast

      private float contrast
      DOCUMENT ME!
    • data

      private int[] data
    • img

      private Image img
      DOCUMENT ME!
    • imgWidth

      private int imgWidth
      DOCUMENT ME!
    • imgHeight

      private int imgHeight
      DOCUMENT ME!
    • memImage

      private MemoryImageSource memImage
      DOCUMENT ME!
  • Constructor Details

    • Thumbnail

      public Thumbnail(int xDim, int yDim, int[] data)
      Default constructor for the Thumbnail.
      Parameters:
      xDim - Width of image
      yDim - Height of image
      data - actual image data (stored in ARGB packed int format)
  • Method Details

    • finalize

      public void finalize()
      Cleans up the thumbnail AWT Image and int[] array.
      Overrides:
      finalize in class Object
    • getPreferredSize

      public Dimension getPreferredSize()
      Gets the preferred size based on the parent (container's) size.
      Overrides:
      getPreferredSize in class JComponent
      Returns:
      the preferred size of the thumbnail
    • paintComponent

      public void paintComponent(Graphics g)
      Draws the component.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - graphics g
    • setBrightnessContrast

      public void setBrightnessContrast(int brightness, float contrast)
      Sets the brightness and contrast levels for the image.
      Parameters:
      brightness - the thumbnail brightness
      contrast - the thumbnail contrast
    • setImgSize

      public void setImgSize(int width, int height)
      Sets the image size based on the panel that is displaying it (its parent).
      Parameters:
      width - panel width
      height - panel height