Class ThumbnailDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ThumbnailDialog extends JDialog
A dialog for saving thumbnail images of a TrackerPanel.
Author:
Douglas Brown
See Also:
  • Field Details

  • Method Details

    • getDialog

      public static ThumbnailDialog getDialog(TrackerPanel panel, boolean withSaveButton)
      Returns the singleton ThumbnailDialog for a specified TrackerPanel.
      Parameters:
      panel - the TrackerPanel
      withSaveButton - true to include the "Save As" button
      Returns:
      the ThumbnailDialog
    • saveThumbnail

      public File saveThumbnail(String filePath)
      Saves a thumbnail image of the current frame using the current dropdown choices.
      Parameters:
      filePath - the path to the target image file (may be null)
      Returns:
      the saved image file, or null if cancelled or failed
    • getThumbnail

      public BufferedImage getThumbnail()
      Gets a thumbnail image of the TrackerPanel.
      Returns:
      a BufferedImage
    • getThumbnailSize

      public Dimension getThumbnailSize()
      Gets the size of the thumbnail image.
      Returns:
      a Dimension
    • setFormat

      public void setFormat(String format)
      Sets the image format (filename extension).
      Parameters:
      format - "png" or "jpg"
    • getFormat

      public String getFormat()
      Gets the image format (filename extension).
      Returns:
      "png" or "jpg"
    • setVisible

      public void setVisible(boolean vis)
      Overrides:
      setVisible in class Dialog
    • refreshGUI

      protected void refreshGUI()
      Refreshes the visible components of this dialog.
    • dispose

      public void dispose()
      Overrides:
      dispose in class Window
    • clear

      public void clear()