java.lang.Object
javax.swing.AbstractAction
com.marginallyclever.ro3.apps.actions.LoadScene
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action

public class LoadScene extends AbstractAction
Load a scene from a file. Completely replaces the current Scene.
See Also:
  • Constructor Details

    • LoadScene

      public LoadScene(RecentFilesMenu menu, String filePath)

      This constructor is used when the user selects a file from the RecentFilesMenu. Therefore no selection dialog will appear, therefore a file chooser is not needed.

      Parameters:
      menu - the RecentFilesMenu that this action is attached to.
      filePath - the path to the file to load.
    • LoadScene

      public LoadScene(RecentFilesMenu menu, String filePath, JFileChooser chooser)

      This constructor is used when the user has not selected a file from the RecentFilesMenu. Therefore the file selection dialog will appear, therefore a file chooser is needed.

      Parameters:
      menu - the RecentFilesMenu that this action is attached to.
      filePath - the path to the file to load.
      chooser - the file chooser to use.
  • Method Details

    • setSaveScene

      public void setSaveScene(SaveScene saveScene)
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Invoked when an action occurs.
      Parameters:
      e - the event to be processed
    • commitLoad

      public void commitLoad(File selectedFile)