Class Screenshot


  • public class Screenshot
    extends ChartPlugin
    Plugin allowing to take a screenshot of the complete chart. Allows to copy image to clipboard or to save as a file.
    Author:
    Alexander Krimm
    • Constructor Detail

      • Screenshot

        public Screenshot()
        Create a screenshot plugin instance
    • Method Detail

      • patternProperty

        public javafx.beans.property.StringProperty patternProperty()
        Gets the pattern property for filename generation. For the pattern syntax see DataSetUtils.getFileName(DataSet, String)
        Returns:
        The pattern property to generate template filenames
      • setPattern

        public void setPattern​(java.lang.String pattern)
        Sets the pattern for the initial filename. For the pattern syntax see DataSetUtils.getFileName(DataSet, String)
        Parameters:
        pattern - A pattern to generate template filenames
      • getPattern

        public java.lang.String getPattern()
        Gets the pattern for the initial filename. For the pattern syntax see DataSetUtils.getFileName(DataSet, String)
        Returns:
        The pattern to generate template filenames
      • directoryProperty

        public javafx.beans.property.StringProperty directoryProperty()
        Gets the directory property for saving screenshots.
        Returns:
        the property holding the save directory
      • setDirectory

        public void setDirectory​(java.lang.String directory)
        Sets the initial directory for the screenshot safe dialog.
        Parameters:
        directory - The directory to save screenshots to
      • getDirectory

        public java.lang.String getDirectory()
        Gets the directory to save screenshots.
        Returns:
        The directory where the screenshots will be saved
      • getScreenshotInteractorBar

        public javafx.scene.layout.HBox getScreenshotInteractorBar()
        Returns:
        A node with screenshot buttons which can be inserted into the toolbar
      • screenshotToClipboard

        public void screenshotToClipboard()
        Save screenshot to clipbaord
      • screenshotToFile

        public void screenshotToFile​(boolean showDialog)
        saves a screenshot to a file that can be chosen with a file opener
        Parameters:
        showDialog - whether to show the file save dialog or to just save to the filename given by pattern
      • generateScreenshotName

        public java.lang.String generateScreenshotName()
        Returns:
        a Default name for the Screenshot
      • getScreenshot

        public javafx.scene.image.Image getScreenshot()
        Returns:
        An image containing a screenshot of the complete chart