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
+ 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)
 
void growSelection ()
 
void mapViewClosing (@NotNull final MapView< G, A, R > mapView)
 
void mapViewCreated (@NotNull final MapView< G, A, R > mapView)
 
void setAction (@NotNull final Action action, @NotNull final String name)
 

Private Member Functions

boolean doGrowSelection (final boolean performAction)
 
void updateAction ()
 

Private Attributes

Action action
 
MapView< G, A, R > currentMapView
 
final MapGridListener mapGridListener
 

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

◆ 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 106 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 163 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 159 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

◆ currentMapView

◆ 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.

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


The documentation for this class was generated from the following file:
net.sf.gridarta.action.GrowSelectionAction.updateAction
void updateAction()
Definition: GrowSelectionAction.java:95