Package smile.plot.swing
Interface Scene
- All Superinterfaces:
Printable
- All Known Implementing Classes:
Canvas
,MultiFigurePane
Printable scene of mathematical plots.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Action to print the scene.static class
Action to save the scene to an image file. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AtomicInteger
The number of created windows, as the default window title.Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
-
Method Summary
Modifier and TypeMethodDescriptioncontent()
Returns the content component.default void
print()
Prints the scene.default int
print
(Graphics g, PageFormat pf, int page) default Action
Returns the print action.default void
save()
Shows a file chooser and exports the scene to the selected image file.default void
Exports the scene to an image file.default Action
Returns the save action.default Image
toImage()
Exports the scene to an image.toolbar()
Returns a toolbar to control the plot.default JFrame
window()
Shows the scene in a window.
-
Field Details
-
WindowCount
The number of created windows, as the default window title.
-
-
Method Details
-
content
JComponent content()Returns the content component.- Returns:
- the content component.
-
toolbar
JToolBar toolbar()Returns a toolbar to control the plot.- Returns:
- a toolbar to control the plot.
-
saveAction
Returns the save action.- Returns:
- the save action.
-
printAction
Returns the print action.- Returns:
- the print action.
-
print
-
save
Shows a file chooser and exports the scene to the selected image file.- Throws:
IOException
- if an error occurs during writing.
-
save
Exports the scene to an image file.- Parameters:
file
- the destination file.- Throws:
IOException
- if an error occurs during writing.
-
toImage
Exports the scene to an image.- Returns:
- the image of scene.
-
print
default void print()Prints the scene. -
window
Shows the scene in a window.- Returns:
- a new JFrame that contains the scene.
- Throws:
InterruptedException
- if we're interrupted while waiting for the event dispatching thread to finish executing.InvocationTargetException
- if an exception is thrown while showing the frame.
-