![]() |
Gridarta Editor
|
Manages edit type actions in "view" menu. More...
Public Member Functions | |
void | init (@NotNull final Iterable< NamedGameObjectMatcher > gameObjectMatchers) |
Creates the view actions. More... | |
void | resetView () |
Action method for "reset view". More... | |
void | setAction (@NotNull final Action action, @NotNull final String name) |
Sets the Action instance for this editor action. More... | |
void | setMenu (@Nullable final Container viewActionsMenu) |
Sets the menu to add the actions to. More... | |
ViewActions (@NotNull final MapViewSettings mapViewSettings, @NotNull final MapManager< G, A, R > mapManager) | |
Creates a new instance. More... | |
Private Member Functions | |
void | updateActions () |
Updates the actions' state to the current edit mode. More... | |
Private Attributes | |
final MapManagerListener< G, A, R > | mapManagerListener |
The map manager listener which is attached to the current map if the current map is tracked. More... | |
final MapViewSettings | mapViewSettings |
The map view settings instance. More... | |
final MapViewSettingsListener | mapViewSettingsListener |
The MapViewSettingsListener attached to mapViewSettings to detect edit types changes. More... | |
final List< ViewAction > | viewActions = new LinkedList<>() |
The view actions. More... | |
Static Private Attributes | |
static final Comparator< ViewAction > | ACTION_NAME_COMPARATOR = (o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName()) |
The comparator for sorting menu entries. More... | |
Manages edit type actions in "view" menu.
Definition at line 46 of file ViewActions.java.
net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.ViewActions | ( | @NotNull final MapViewSettings | mapViewSettings, |
@NotNull final MapManager< G, A, R > | mapManager | ||
) |
Creates a new instance.
mapViewSettings | the map view settings instance |
mapManager | the map manager |
Definition at line 143 of file ViewActions.java.
References net.sf.gridarta.model.mapviewsettings.MapViewSettings.addMapViewSettingsListener(), net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapManagerListener, net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapViewSettings, and net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapViewSettingsListener.
void net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.init | ( | @NotNull final Iterable< NamedGameObjectMatcher > | gameObjectMatchers | ) |
Creates the view actions.
gameObjectMatchers | the game object matchers |
Definition at line 159 of file ViewActions.java.
References net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapViewSettings, and net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.viewActions.
void net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.resetView | ( | ) |
Action method for "reset view".
Definition at line 186 of file ViewActions.java.
References net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapViewSettings, and net.sf.gridarta.model.mapviewsettings.MapViewSettings.unsetEditType().
void net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setAction | ( | @NotNull final Action | action, |
@NotNull final String | name | ||
) |
Sets the Action instance for this editor action.
action | the action instance |
name | the name of the action |
Implements net.sf.gridarta.utils.EditorAction.
Definition at line 201 of file ViewActions.java.
void net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setMenu | ( | @Nullable final Container | viewActionsMenu | ) |
Sets the menu to add the actions to.
viewActionsMenu | the menu |
Definition at line 169 of file ViewActions.java.
References net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.ACTION_NAME_COMPARATOR, and net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.viewActions.
|
private |
Updates the actions' state to the current edit mode.
Definition at line 194 of file ViewActions.java.
|
staticprivate |
The comparator for sorting menu entries.
Definition at line 153 of file ViewActions.java.
|
private |
The map manager listener which is attached to the current map if the current map is tracked.
Otherwise it is unused.
Definition at line 65 of file ViewActions.java.
|
private |
The map view settings instance.
Definition at line 52 of file ViewActions.java.
Referenced by net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.init(), net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.resetView(), and net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.ViewActions().
|
private |
The MapViewSettingsListener attached to mapViewSettings to detect edit types changes.
Definition at line 94 of file ViewActions.java.
|
private |
The view actions.
Definition at line 58 of file ViewActions.java.
Referenced by net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.init(), net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setMenu(), and net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updateActions().