Package VASSAL.launch
Class GameModuleAction
java.lang.Object
javax.swing.AbstractAction
VASSAL.launch.GameModuleAction
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
- Direct Known Subclasses:
CreateModuleAction
,LoadModuleAction
,NewExtensionAction
public abstract class GameModuleAction extends AbstractAction
Utility base class for
GameModule
-related actions, with auxilliary
actions and error reporting.- Author:
- rodneykinney
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected boolean
actionCancelled
protected List<Runnable>
actions
protected Component
comp
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
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
Constructors Constructor Description GameModuleAction(String name, Component comp)
-
Method Summary
Modifier and Type Method Description void
actionPerformed(ActionEvent e)
void
addAction(Runnable r)
Add an auxilliary action to be performed after the core action.protected String
getMessage(Exception err)
protected abstract void
performAction(ActionEvent evt)
protected void
reportError(Exception ex)
protected void
runActions()
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
comp
-
actionCancelled
protected boolean actionCancelled -
actions
-
-
Constructor Details
-
GameModuleAction
-
-
Method Details
-
getMessage
-
actionPerformed
-
performAction
- Throws:
Exception
-
reportError
-
addAction
Add an auxilliary action to be performed after the core action. For example, closing a window after a module has been loaded- Parameters:
r
-
-
runActions
protected void runActions()
-