Gridarta Editor
|
Static Public Member Functions | |
static String | getActionCategory (@NotNull final Action action) |
static String | getActionDescription (@NotNull final Action action) |
static Icon | getActionIcon (@NotNull final Action action) |
static String | getActionId (@NotNull final Action action) |
static String | getActionName (@NotNull final Action action) |
static KeyStroke | getAlternativeShortcut (@NotNull final Action action) |
static KeyStroke | getShortcut (@NotNull final Action action) |
static String | getShortcutDescription (@NotNull final Action action, @NotNull final String key) |
static Action | newAction (@NotNull final ActionBuilder actionBuilder, @NotNull final String category, @NotNull final EditorAction editorAction, @NotNull final String key) |
static Action | newToggleAction (@NotNull final ActionBuilder actionBuilder, @NotNull final String category, @NotNull final EditorAction editorAction, @NotNull final String key) |
static void | setActionShortcut (@NotNull final Action action, @Nullable final KeyStroke shortcut) |
Static Public Attributes | |
static final String | DEFAULT_ACCELERATOR_KEY = "DefaultAcceleratorKey" |
static final String | NO_SHORTCUT = "none" |
Private Member Functions | |
ActionUtils () | |
Static Private Member Functions | |
static KeyStroke | getShortcut (@NotNull final Action action, @NotNull final String key) |
static String | getStringValue (@NotNull final Action action, @NotNull final String key) |
Static Private Attributes | |
static final String | CATEGORY = "Category" |
static final String | UNDEFINED_CATEGORY = "Other" |
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 235 of file ActionUtils.java.
References net.sf.gridarta.utils.ActionUtils.CATEGORY, 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().
|
static |
Returns the description for an Action.
action | the action |
Definition at line 104 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().
|
static |
Returns an Icon associated with the action.
action | the action |
Definition at line 174 of file ActionUtils.java.
Referenced by net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.createPanel().
|
static |
Returns an Action's ID string.
action | the action |
IllegalArgumentException | if the action does not define an ID string |
Definition at line 90 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().
|
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().
|
static |
Returns the alternative shortcut of an Action.
action | the action |
Definition at line 130 of file ActionUtils.java.
References net.sf.gridarta.utils.ActionUtils.getShortcut().
|
static |
Returns the shortcut of an Action.
action | the action |
Definition at line 120 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().
|
staticprivate |
Returns the shortcut of an Action.
action | the action |
key | the action key to query |
Definition at line 141 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 163 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().
|
staticprivate |
Returns an Action's value as a string.
action | the action |
key | the key to query |
Definition at line 187 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().
|
static |
Creates a new Action instance. It is basically the same as {} 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 the new action
Definition at line 204 of file ActionUtils.java.
References net.sf.gridarta.utils.ActionUtils.CATEGORY.
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().
|
static |
Creates a new Action instance. It is basically the same as {} 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 the new action
Definition at line 222 of file ActionUtils.java.
References net.sf.gridarta.utils.ActionUtils.CATEGORY.
|
static |
Sets the shortcut of an Action.
action | the action |
shortcut | the shortcut or null
|
Definition at line 151 of file ActionUtils.java.
Referenced by net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.shortcutsSetShortcut(), and net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.shortcutsUnsetShortcut().
|
staticprivate |
Action key for the action's category.
Definition at line 39 of file ActionUtils.java.
Referenced by net.sf.gridarta.utils.ActionUtils.getActionCategory(), net.sf.gridarta.utils.ActionUtils.newAction(), and net.sf.gridarta.utils.ActionUtils.newToggleAction().
|
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 {}.
Definition at line 46 of file ActionUtils.java.
Referenced by net.sf.gridarta.utils.ActionUtils.getActionCategory().