Gridarta Editor
net.sf.gridarta.action.ShrinkSelectionAction< 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.ShrinkSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.action.ShrinkSelectionAction< 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 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)
 
void shrinkSelection ()
 

Private Member Functions

boolean doShrinkSelection (final boolean performAction)
 
void updateAction ()
 

Private Attributes

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

Detailed Description

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

Author
Andreas Kirschbaum

Definition at line 48 of file ShrinkSelectionAction.java.

Member Function Documentation

◆ activeMapViewChanged()

◆ doShrinkSelection()

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

Shrinks 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 109 of file ShrinkSelectionAction.java.

References net.sf.gridarta.model.mapgrid.MapGrid.beginTransaction(), net.sf.gridarta.action.ShrinkSelectionAction< 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.mapgrid.MapGrid.getFlags(), 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.mapgrid.MapGrid.GRID_FLAG_SELECTION, net.sf.gridarta.model.maparchobject.MapArchObject< A extends MapArchObject< A >.isPointValid(), net.sf.gridarta.model.mapgrid.MapGrid.select(), and net.sf.gridarta.model.mapgrid.SelectionMode.SUB.

Referenced by net.sf.gridarta.action.ShrinkSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.shrinkSelection(), and net.sf.gridarta.action.ShrinkSelectionAction< 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:

◆ mapViewClosing()

void net.sf.gridarta.action.ShrinkSelectionAction< 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 176 of file ShrinkSelectionAction.java.

◆ mapViewCreated()

void net.sf.gridarta.action.ShrinkSelectionAction< 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 171 of file ShrinkSelectionAction.java.

◆ setAction()

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

◆ shrinkSelection()

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

Grows the current map selection by one map square.

Definition at line 85 of file ShrinkSelectionAction.java.

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

+ Here is the call graph for this function:

◆ updateAction()

Member Data Documentation

◆ action

◆ currentMapView

◆ mapGridListener

final MapGridListener net.sf.gridarta.action.ShrinkSelectionAction< 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 67 of file ShrinkSelectionAction.java.

Referenced by net.sf.gridarta.action.ShrinkSelectionAction< 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.ShrinkSelectionAction.updateAction
void updateAction()
Definition: ShrinkSelectionAction.java:98