Class LoadScene
java.lang.Object
javax.swing.AbstractAction
com.marginallyclever.ro3.apps.actions.LoadScene
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
Load a scene from a file. Completely replaces the current Scene.
- See Also:
-
Field Summary
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
Constructor Summary
ConstructorDescriptionLoadScene
(RecentFilesMenu menu, String filePath) This constructor is used when the user selects a file from the RecentFilesMenu.LoadScene
(RecentFilesMenu menu, String filePath, JFileChooser chooser) This constructor is used when the user has not selected a file from the RecentFilesMenu. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked when an action occurs.void
commitLoad
(File selectedFile) void
setSaveScene
(SaveScene saveScene) Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
LoadScene
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
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
-
actionPerformed
Invoked when an action occurs.- Parameters:
e
- the event to be processed
-
commitLoad
-