Class ComponentContentPanel

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.data.image.BufferedImageSupporter, adams.gui.core.PopupMenuProvider, ImageObserver, MenuContainer, Serializable, Accessible

    public class ComponentContentPanel
    extends AbstractOutputPanelWithPopupMenu<adams.gui.print.JComponentWriterFileChooser>
    implements adams.data.image.BufferedImageSupporter
    Panel for exporting the graphical component as image.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Component

        protected JComponent m_Component
        the actual component.
    • Constructor Detail

      • ComponentContentPanel

        public ComponentContentPanel​(JComponent comp,
                                     boolean useScrollPane)
        Initializes the panel with the specified component.
        Parameters:
        comp - the component to embed
        useScrollPane - whether to use a scroll pane
    • Method Detail

      • getComponent

        public JComponent getComponent()
        Returns the embedded component.
        Returns:
        the component
      • createFileChooser

        protected adams.gui.print.JComponentWriterFileChooser createFileChooser()
        Creates the filechooser to use.
        Specified by:
        createFileChooser in class AbstractOutputPanelWithPopupMenu<adams.gui.print.JComponentWriterFileChooser>
        Returns:
        the filechooser
      • save

        protected String save​(File file)
        Saves the content to the specified file.
        Specified by:
        save in class AbstractOutputPanelWithPopupMenu<adams.gui.print.JComponentWriterFileChooser>
        Parameters:
        file - the file to save to
        Returns:
        null if successful, otherwise error message
      • toBufferedImage

        public BufferedImage toBufferedImage()
        Returns a buffered image.
        Specified by:
        toBufferedImage in interface adams.data.image.BufferedImageSupporter
        Returns:
        the buffered image