Interface Scene

All Superinterfaces:
Printable
All Known Implementing Classes:
Canvas, MultiFigurePane

public interface Scene extends Printable
Printable scene of mathematical plots.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Action to print the scene.
    static class 
    Action to save the scene to an image file.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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 Type
    Method
    Description
    Returns the content component.
    default void
    Prints the scene.
    default int
    print(Graphics g, PageFormat pf, int page)
     
    default Action
    Returns the print action.
    default void
    Shows a file chooser and exports the scene to the selected image file.
    default void
    save(File file)
    Exports the scene to an image file.
    default Action
    Returns the save action.
    default Image
    Exports the scene to an image.
    Returns a toolbar to control the plot.
    default JFrame
    Shows the scene in a window.
  • Field Details

    • WindowCount

      static final AtomicInteger 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

      default Action saveAction()
      Returns the save action.
      Returns:
      the save action.
    • printAction

      default Action printAction()
      Returns the print action.
      Returns:
      the print action.
    • print

      default int print(Graphics g, PageFormat pf, int page)
      Specified by:
      print in interface Printable
    • save

      default void save() throws IOException
      Shows a file chooser and exports the scene to the selected image file.
      Throws:
      IOException - if an error occurs during writing.
    • save

      default void save(File file) throws IOException
      Exports the scene to an image file.
      Parameters:
      file - the destination file.
      Throws:
      IOException - if an error occurs during writing.
    • toImage

      default Image 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.