Package de.gsi.chart.plugins
Class Screenshot
- java.lang.Object
-
- de.gsi.chart.plugins.ChartPlugin
-
- de.gsi.chart.plugins.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classScreenshot.ScreenshotDialog
-
Constructor Summary
Constructors Constructor Description Screenshot()Create a screenshot plugin instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.StringPropertydirectoryProperty()Gets the directory property for saving screenshots.java.lang.StringgenerateScreenshotName()java.lang.StringgetDirectory()Gets the directory to save screenshots.java.lang.StringgetPattern()Gets the pattern for the initial filename.javafx.scene.image.ImagegetScreenshot()javafx.scene.layout.HBoxgetScreenshotInteractorBar()javafx.beans.property.StringPropertypatternProperty()Gets the pattern property for filename generation.voidscreenshotToClipboard()Save screenshot to clipbaordvoidscreenshotToFile(boolean showDialog)saves a screenshot to a file that can be chosen with a file openervoidsetDirectory(java.lang.String directory)Sets the initial directory for the screenshot safe dialog.voidsetPattern(java.lang.String pattern)Sets the pattern for the initial filename.-
Methods inherited from class de.gsi.chart.plugins.ChartPlugin
addButtonsToToolBarProperty, chartProperty, getChart, getChartChildren, getLocationInPlotArea, isAddButtonsToToolBar, layoutChildren, registerInputEventHandler, setAddButtonsToToolBar, setChart, toDataPoint, toDisplayPoint
-
-
-
-
Method Detail
-
patternProperty
public javafx.beans.property.StringProperty patternProperty()
Gets the pattern property for filename generation. For the pattern syntax seeDataSetUtils.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 seeDataSetUtils.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 seeDataSetUtils.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
-
-