Gridarta Editor
net.sf.gridarta.utils.ActionUtils Class Reference
+ Collaboration diagram for net.sf.gridarta.utils.ActionUtils:

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"
 

Detailed Description

Utility class implementing Action related functions.

Author
Andreas Kirschbaum

Definition at line 33 of file ActionUtils.java.

Constructor & Destructor Documentation

◆ ActionUtils()

net.sf.gridarta.utils.ActionUtils.ActionUtils ( )
private

Private construct to prevent instantiation.

Definition at line 63 of file ActionUtils.java.

Member Function Documentation

◆ getActionCategory()

static String net.sf.gridarta.utils.ActionUtils.getActionCategory ( @NotNull final Action  action)
static

Returns an Action's category.

Parameters
actionthe action
Returns
the category

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActionDescription()

static String net.sf.gridarta.utils.ActionUtils.getActionDescription ( @NotNull final Action  action)
static

Returns the description for an Action.

Parameters
actionthe action
Returns
the description

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActionIcon()

static Icon net.sf.gridarta.utils.ActionUtils.getActionIcon ( @NotNull final Action  action)
static

Returns an Icon associated with the action.

Parameters
actionthe action
Returns
the icon or
null

Definition at line 174 of file ActionUtils.java.

Referenced by net.sf.gridarta.gui.dialog.shortcuts.ShortcutsDialog.createPanel().

+ Here is the caller graph for this function:

◆ getActionId()

static String net.sf.gridarta.utils.ActionUtils.getActionId ( @NotNull final Action  action)
static

Returns an Action's ID string.

Parameters
actionthe action
Returns
the ID string
Exceptions
IllegalArgumentExceptionif 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActionName()

static String net.sf.gridarta.utils.ActionUtils.getActionName ( @NotNull final Action  action)
static

Returns the name of an Action.

Parameters
actionthe action
Returns
the name

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:

◆ getAlternativeShortcut()

static KeyStroke net.sf.gridarta.utils.ActionUtils.getAlternativeShortcut ( @NotNull final Action  action)
static

Returns the alternative shortcut of an Action.

Parameters
actionthe action
Returns
the alternative shortcut or
null

Definition at line 130 of file ActionUtils.java.

References net.sf.gridarta.utils.ActionUtils.getShortcut().

Referenced by net.sf.gridarta.gui.map.mapview.DefaultMapView< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.installAccelerator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShortcut() [1/2]

◆ getShortcut() [2/2]

static KeyStroke net.sf.gridarta.utils.ActionUtils.getShortcut ( @NotNull final Action  action,
@NotNull final String  key 
)
staticprivate

Returns the shortcut of an Action.

Parameters
actionthe action
keythe action key to query
Returns
the shortcut or
null

Definition at line 141 of file ActionUtils.java.

◆ getShortcutDescription()

static String net.sf.gridarta.utils.ActionUtils.getShortcutDescription ( @NotNull final Action  action,
@NotNull final String  key 
)
static

Returns a description of the shortcut of an Action. Returns NO_SHORTCUT if the action defines no shortcut.

Parameters
actionthe action
keythe action key to query
Returns
the description

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStringValue()

static String net.sf.gridarta.utils.ActionUtils.getStringValue ( @NotNull final Action  action,
@NotNull final String  key 
)
staticprivate

Returns an Action's value as a string.

Parameters
actionthe action
keythe key to query
Returns
the value as a string or
null
if no such key is defined of if the value is not a string

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().

+ Here is the caller graph for this function:

◆ newAction()

static Action net.sf.gridarta.utils.ActionUtils.newAction ( @NotNull final ActionBuilder  actionBuilder,
@NotNull final String  category,
@NotNull final EditorAction  editorAction,
@NotNull final String  key 
)
static

◆ newToggleAction()

static Action net.sf.gridarta.utils.ActionUtils.newToggleAction ( @NotNull final ActionBuilder  actionBuilder,
@NotNull final String  category,
@NotNull final EditorAction  editorAction,
@NotNull final String  key 
)
static

◆ setActionShortcut()

static void net.sf.gridarta.utils.ActionUtils.setActionShortcut ( @NotNull final Action  action,
@Nullable final KeyStroke  shortcut 
)
static

Sets the shortcut of an Action.

Parameters
actionthe action
shortcutthe shortcut or
null
to remove it

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().

+ Here is the caller graph for this function:

Member Data Documentation

◆ CATEGORY

final String net.sf.gridarta.utils.ActionUtils.CATEGORY = "Category"
staticprivate

◆ DEFAULT_ACCELERATOR_KEY

final String net.sf.gridarta.utils.ActionUtils.DEFAULT_ACCELERATOR_KEY = "DefaultAcceleratorKey"
static

◆ NO_SHORTCUT

final String net.sf.gridarta.utils.ActionUtils.NO_SHORTCUT = "none"
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().

◆ UNDEFINED_CATEGORY

final String net.sf.gridarta.utils.ActionUtils.UNDEFINED_CATEGORY = "Other"
staticprivate

Category value for Actions not defining a {}.

Definition at line 46 of file ActionUtils.java.

Referenced by net.sf.gridarta.utils.ActionUtils.getActionCategory().


The documentation for this class was generated from the following file: