Gridarta Editor
net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Class Template Reference

Manages edit type actions in "view" menu. More...

+ Inheritance diagram for net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

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< ViewActionviewActions = new LinkedList<>()
 The view actions. More...
 

Static Private Attributes

static final Comparator< ViewActionACTION_NAME_COMPARATOR = (o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName())
 The comparator for sorting menu entries. More...
 

Detailed Description

Manages edit type actions in "view" menu.

Author
Andreas Kirschbaum

Definition at line 46 of file ViewActions.java.

Constructor & Destructor Documentation

◆ ViewActions()

Member Function Documentation

◆ init()

◆ resetView()

◆ setAction()

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.

Parameters
actionthe action instance
namethe name of the action

Implements net.sf.gridarta.utils.EditorAction.

Definition at line 201 of file ViewActions.java.

◆ setMenu()

◆ updateActions()

void net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updateActions ( )
private

Member Data Documentation

◆ ACTION_NAME_COMPARATOR

final Comparator<ViewAction> 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 = (o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName())
staticprivate

◆ mapManagerListener

final MapManagerListener<G, A, R> net.sf.gridarta.gui.map.viewaction.ViewActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapManagerListener
private
Initial value:
= new MapManagerListener<G, A, R>() {
@Override
public void currentMapChanged(@Nullable final MapControl<G, A, R> mapControl) {
}
@Override
public void mapCreated(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) {
}
@Override
public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) {
}
@Override
public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) {
}
}

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.

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

◆ mapViewSettings

◆ mapViewSettingsListener

◆ viewActions


The documentation for this class was generated from the following file:
net.sf.gridarta.gui.map.viewaction.ViewActions.updateActions
void updateActions()
Updates the actions' state to the current edit mode.
Definition: ViewActions.java:194