|
Gridarta Editor
|
Utility class implementing Action related functions. More...
Collaboration diagram for net.sf.gridarta.utils.ActionUtils:Static Public Member Functions | |
| static String | getActionCategory (@NotNull final Action action) |
| Returns an Action's category. More... | |
| static String | getActionDescription (@NotNull final Action action) |
| Returns the description for an Action. More... | |
| static Icon | getActionIcon (@NotNull final Action action) |
| Returns an Icon associated with the action. More... | |
| static String | getActionId (@NotNull final Action action) |
| Returns an Action's ID string. More... | |
| static String | getActionName (@NotNull final Action action) |
| Returns the name of an Action. More... | |
| static KeyStroke | getAlternativeShortcut (@NotNull final Action action) |
| Returns the alternative shortcut of an Action. More... | |
| static KeyStroke | getShortcut (@NotNull final Action action) |
| Returns the shortcut of an Action. More... | |
| static String | getShortcutDescription (@NotNull final Action action, @NotNull final String key) |
| Returns a description of the shortcut of an Action. More... | |
| static Action | newAction (@NotNull final ActionBuilder actionBuilder, @NotNull final String category, @NotNull final EditorAction editorAction, @NotNull final String key) |
| Creates a new Action instance. More... | |
| static Action | newToggleAction (@NotNull final ActionBuilder actionBuilder, @NotNull final String category, @NotNull final EditorAction editorAction, @NotNull final String key) |
| Creates a new Action instance. More... | |
| static void | setActionShortcut (@NotNull final Action action, @Nullable final KeyStroke shortcut) |
| Sets the shortcut of an Action. More... | |
Static Public Attributes | |
| static final String | DEFAULT_ACCELERATOR_KEY = "DefaultAcceleratorKey" |
| Action key to store the default shortcut. More... | |
| static final String | NO_SHORTCUT = "none" |
| The shortcut description for actions without shortcuts. More... | |
Private Member Functions | |
| ActionUtils () | |
| Private construct to prevent instantiation. More... | |
Static Private Member Functions | |
| static KeyStroke | getShortcut (@NotNull final Action action, @NotNull final String key) |
| Returns the shortcut of an Action. More... | |
| static String | getStringValue (@NotNull final Action action, @NotNull final String key) |
| Returns an Action's value as a string. More... | |
Static Private Attributes | |
| static final String | CATEGORY = "Category" |
| Action key for the action's category. More... | |
| static final String | UNDEFINED_CATEGORY = "Other" |
| Category value for Actions not defining a CATEGORY. More... | |
Utility class implementing Action related functions.
Definition at line 33 of file ActionUtils.java.
|
private |
Private construct to prevent instantiation.
Definition at line 63 of file ActionUtils.java.
|
static |
Returns an Action's category.
| action | the action |
Definition at line 243 of file ActionUtils.java.
References net.sf.gridarta.utils.ActionUtils.getStringValue(), and net.sf.gridarta.utils.ActionUtils.UNDEFINED_CATEGORY.
Referenced by net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.createNodes(), and net.sf.gridarta.gui.dialog.shortcuts.KeyStrokeDialog.updateKeyStroke().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns the description for an Action.
| action | the action |
Definition at line 108 of file ActionUtils.java.
References net.sf.gridarta.utils.ActionUtils.getStringValue().
Referenced by net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.createPanel(), and net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.updateSelectedAction().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns an Icon associated with the action.
| action | the action |
Definition at line 182 of file ActionUtils.java.
Referenced by net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.createPanel().
Here is the caller graph for this function:
|
static |
Returns an Action's ID string.
| action | the action |
| IllegalArgumentException | if the action does not define an ID string |
Definition at line 94 of file ActionUtils.java.
References net.sf.gridarta.utils.ActionUtils.getStringValue().
Referenced by net.sf.gridarta.gui.utils.SwingUtils.addAction(), net.sf.gridarta.gui.utils.MenuUtils.findMenu(), net.sf.gridarta.utils.ActionUtils.getActionName(), net.sf.gridarta.gui.dialog.shortcuts.ShortcutsManager.isValidAction(), net.sf.gridarta.gui.dialog.shortcuts.ShortcutsManager.loadShortcuts(), and net.sf.gridarta.gui.dialog.shortcuts.ShortcutsManager.saveShortcuts().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns the name of an Action.
| action | the action |
Definition at line 72 of file ActionUtils.java.
References net.sf.gridarta.utils.ActionUtils.getActionId(), and net.sf.gridarta.utils.ActionUtils.getStringValue().
Referenced by net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.getTitle(), net.sf.gridarta.gui.dialog.shortcuts.ShortcutsManager.loadShortcuts(), and net.sf.gridarta.gui.dialog.shortcuts.KeyStrokeDialog.updateKeyStroke().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns the alternative shortcut of an Action.
| action | the action |
Definition at line 138 of file ActionUtils.java.
References net.sf.gridarta.utils.ActionUtils.getShortcut().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns the shortcut of an Action.
| action | the action |
Definition at line 128 of file ActionUtils.java.
Referenced by net.sf.gridarta.utils.ActionUtils.getAlternativeShortcut(), net.sf.gridarta.utils.ActionUtils.getShortcutDescription(), net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.getUnsetShortcutEnabled(), net.sf.gridarta.gui.map.mapview.DefaultMapView< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.installAccelerator(), net.sf.gridarta.gui.dialog.shortcuts.KeyStrokeDialog.KeyStrokeDialog(), and net.sf.gridarta.gui.dialog.shortcuts.KeyStrokeDialog.updateKeyStroke().
Here is the caller graph for this function:
|
staticprivate |
Returns the shortcut of an Action.
| action | the action |
| key | the action key to query |
Definition at line 149 of file ActionUtils.java.
|
static |
Returns a description of the shortcut of an Action.
Returns NO_SHORTCUT if the action defines no shortcut.
| action | the action |
| key | the action key to query |
Definition at line 171 of file ActionUtils.java.
References net.sf.gridarta.utils.ActionUtils.getShortcut(), and net.sf.gridarta.utils.ActionUtils.NO_SHORTCUT.
Referenced by net.sf.gridarta.gui.dialog.shortcuts.ShortcutsManager.saveShortcuts(), and net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.updateSelectedAction().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Returns an Action's value as a string.
| action | the action |
| key | the key to query |
Definition at line 195 of file ActionUtils.java.
Referenced by net.sf.gridarta.utils.ActionUtils.getActionCategory(), net.sf.gridarta.utils.ActionUtils.getActionDescription(), net.sf.gridarta.utils.ActionUtils.getActionId(), and net.sf.gridarta.utils.ActionUtils.getActionName().
Here is the caller graph for this function:
|
static |
Creates a new Action instance.
It is basically the same as ActionBuilder#createAction(boolean, String, Object) except that the category is set.
| actionBuilder | the action builder to use |
| category | the category to set |
| editorAction | the object which defines the action method |
| key | the action's key |
Definition at line 212 of file ActionUtils.java.
Referenced by net.sf.gridarta.maincontrol.EditorActionManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.createAction(), and net.sf.gridarta.gui.dialog.plugin.PluginController<?, ?, ?>.createRunAction().
Here is the caller graph for this function:
|
static |
Creates a new Action instance.
It is basically the same as ActionBuilder#createToggle(boolean, String, Object) except that the category is set.
| actionBuilder | the action builder to use |
| category | the category to set |
| editorAction | the object which defines the action method |
| key | the action's key |
Definition at line 230 of file ActionUtils.java.
Here is the caller graph for this function:
|
static |
Sets the shortcut of an Action.
| action | the action |
| shortcut | the shortcut or null |
Definition at line 159 of file ActionUtils.java.
Referenced by net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.shortcutsSetShortcut(), and net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.shortcutsUnsetShortcut().
Here is the caller graph for this function:
|
staticprivate |
Action key for the action's category.
Definition at line 39 of file ActionUtils.java.
|
static |
Action key to store the default shortcut.
Definition at line 58 of file ActionUtils.java.
Referenced by net.sf.gridarta.gui.dialog.shortcuts.ShortcutsManager.loadShortcuts(), net.sf.gridarta.gui.dialog.shortcuts.ShortcutsManager.revertAll(), and net.sf.gridarta.gui.dialog.shortcuts.ShortcutsManager.saveShortcuts().
|
static |
The shortcut description for actions without shortcuts.
Definition at line 52 of file ActionUtils.java.
Referenced by net.sf.gridarta.utils.ActionUtils.getShortcutDescription(), and net.sf.gridarta.gui.dialog.shortcuts.ShortcutsManager.loadShortcuts().
|
staticprivate |
Category value for Actions not defining a CATEGORY.
Definition at line 46 of file ActionUtils.java.
Referenced by net.sf.gridarta.utils.ActionUtils.getActionCategory().