Interface Scene
- All Superinterfaces:
Printable
- All Known Implementing Classes:
Canvas, MultiFigurePane
Printable scene of mathematical plots.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAction to print the scene.static classAction to save the scene to an image file. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AtomicIntegerThe number of created windows, as the default window title.Fields inherited from interface Printable
NO_SUCH_PAGE, PAGE_EXISTS -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the content component.default voidprint()Prints the scene.default intprint(Graphics g, PageFormat pf, int page) default ActionReturns the print action.default voidsave()Shows a file chooser and exports the scene to the selected image file.default voidExports the scene to an image file.default ActionReturns the save action.default ImagetoImage()Exports the scene to an image.toolbar()Returns a toolbar to control the plot.default JFramewindow()Shows the scene in a window.
-
Field Details
-
WindowCount
The number of created windows, as the default window title.
-
-
Method Details
-
content
-
toolbar
-
saveAction
-
printAction
-
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
-
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.
-