Gridarta Editor
net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Class Template Reference

An EditorAction that grows the current selection by one map square. More...

+ Inheritance diagram for net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

void activeMapViewChanged (@Nullable final MapView< G, A, R > mapView)
 This event handler is called when the current map view has changed. More...
 
void growSelection ()
 Grows the current map selection by one map square. More...
 
void mapViewClosing (@NotNull final MapView< G, A, R > mapView)
 This event handler is called when a map view is to be closed. More...
 
void mapViewCreated (@NotNull final MapView< G, A, R > mapView)
 This event handler is called when a map view was created. More...
 
void setAction (@NotNull final Action action, @NotNull final String name)
 Sets the Action instance for this editor action. More...
 

Private Member Functions

boolean doGrowSelection (final boolean performAction)
 Grows the current map selection by one map square. More...
 
void updateAction ()
 Updates the action's enabled state. More...
 

Private Attributes

Action action
 The action associated with this editor action. More...
 
MapView< G, A, R > currentMapView
 The active map view, or. More...
 
final MapGridListener mapGridListener
 The MapGridListener attached to currentMapView. More...
 

Detailed Description

An EditorAction that grows the current selection by one map square.

Author
Andreas Kirschbaum

Definition at line 45 of file GrowSelectionAction.java.

Member Function Documentation

◆ activeMapViewChanged()

void net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.activeMapViewChanged ( @Nullable final MapView< G, A, R >  mapView)

◆ doGrowSelection()

boolean net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doGrowSelection ( final boolean  performAction)
private

Grows the current map selection by one map square.

Parameters
performActionwhether the action should be performed
Returns
whether the action was or can be performed

Definition at line 107 of file GrowSelectionAction.java.

References net.sf.gridarta.model.mapgrid.SelectionMode.ADD, net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.currentMapView, net.sf.gridarta.model.mapgrid.MapGrid.endTransaction(), net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapArchObject(), net.sf.gridarta.gui.map.mapview.MapView< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapControl(), net.sf.gridarta.gui.map.mapview.MapView< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapGrid(), net.sf.gridarta.model.mapcontrol.MapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapModel(), net.sf.gridarta.model.mapgrid.MapGrid.getSelectedRec(), net.sf.gridarta.gui.map.mapview.MapView< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getSelectedSquares(), net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.isPointValid(), and net.sf.gridarta.model.mapgrid.MapGrid.select().

Referenced by net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.growSelection(), and net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updateAction().

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

◆ growSelection()

void net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.growSelection ( )

Grows the current map selection by one map square.

Definition at line 82 of file GrowSelectionAction.java.

References net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doGrowSelection().

+ Here is the call graph for this function:

◆ mapViewClosing()

void net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapViewClosing ( @NotNull final MapView< G, A, R >  mapView)

This event handler is called when a map view is to be closed.

Parameters
mapViewthe map view that is to be closed

Implements net.sf.gridarta.gui.map.mapview.MapViewManagerListener< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.

Definition at line 164 of file GrowSelectionAction.java.

◆ mapViewCreated()

void net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapViewCreated ( @NotNull final MapView< G, A, R >  mapView)

This event handler is called when a map view was created.

Parameters
mapViewthe created map view

Implements net.sf.gridarta.gui.map.mapview.MapViewManagerListener< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.

Definition at line 160 of file GrowSelectionAction.java.

◆ setAction()

void net.sf.gridarta.action.GrowSelectionAction< 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 
)

◆ updateAction()

Member Data Documentation

◆ action

Action net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.action
private

The action associated with this editor action.

set to

null

if no action is associated.

Definition at line 58 of file GrowSelectionAction.java.

Referenced by net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setAction().

◆ currentMapView

MapView<G, A, R> net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.currentMapView
private

◆ mapGridListener

final MapGridListener net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapGridListener
private
Initial value:
= new MapGridListener() {
@Override
public void mapGridChanged(@NotNull final MapGridEvent e) {
}
@Override
public void mapGridResized(@NotNull final MapGridEvent e) {
}
}

The MapGridListener attached to currentMapView.

Definition at line 64 of file GrowSelectionAction.java.


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