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

Implements actions for the "file" menu attached to maps. More...

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

Public Member Functions

void closeMap ()
 Invoked when the user wants to close the map. More...
 
void closeNotify ()
 Unregister all registered listeners. More...
 
void createImage ()
 Invoked when the user wants to create an image file of the map. More...
 
 MapFileActions (@NotNull final ImageCreator2< G, A, R > imageCreator2, @NotNull final MapManager< G, A, R > mapManager, @NotNull final MapViewsManager< G, A, R > mapViewsManager, @NotNull final MapViewManager< G, A, R > mapViewManager, @NotNull final FileControl< G, A, R > fileControl, @NotNull final Component mainView)
 Create a new instance that tracks the map state. More...
 
void reloadMap ()
 Invoked when the user wants to reload the map to the previously saved state. More...
 
void saveMap ()
 Invoked when the user wants to save the map. More...
 
void saveMapAs ()
 Invoked when the user wants to save the map to a file. More...
 
void setAction (@NotNull final Action action, @NotNull final String name)
 Sets the Action instance for this editor action. More...
 

Private Member Functions

boolean doCloseMap (final boolean performAction)
 Executes the "close map" action. More...
 
boolean doCreateImage (final boolean performAction)
 Executes the "create image" action. More...
 
boolean doReloadMap (final boolean performAction)
 Executes the "reload map" action. More...
 
boolean doSaveMap (final boolean performAction)
 Executes the "save map" action. More...
 
boolean doSaveMapAs (final boolean performAction)
 Executes the "save map as" action. More...
 
void updateActions ()
 Update the enabled/disabled state of all actions. More...
 

Private Attributes

Action aCloseMap
 The action for "close map". More...
 
Action aCreateImage
 The action for "create image". More...
 
Action aReloadMap
 The action for "reload map". More...
 
Action aSaveMap
 The action for "save map". More...
 
Action aSaveMapAs
 The action for "save map as". More...
 
MapControl< G, A, R > currentMapControl
 The currently tracked map, or. More...
 
MapView< G, A, R > currentMapView
 The current map view, or. More...
 
final FileControl< G, A, R > fileControl
 The file control to forward actions to. More...
 
final ImageCreator2< G, A, R > imageCreator2
 The ImageCreator2 to forwards actions to. More...
 
final Component mainView
 The main view Component. More...
 
final MapManager< G, A, R > mapManager
 The map manager. More...
 
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 MapModelListener< G, A, R > mapModelListener
 The MapModelListener which is attached to currentMapControl's map model. More...
 
final MapViewsManager< G, A, R > mapViewsManager
 The MapViewsManager. More...
 

Detailed Description

Implements actions for the "file" menu attached to maps.

Author
Andreas Kirschbaum

Definition at line 53 of file MapFileActions.java.

Constructor & Destructor Documentation

◆ MapFileActions()

net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.MapFileActions ( @NotNull final ImageCreator2< G, A, R >  imageCreator2,
@NotNull final MapManager< G, A, R >  mapManager,
@NotNull final MapViewsManager< G, A, R >  mapViewsManager,
@NotNull final MapViewManager< G, A, R >  mapViewManager,
@NotNull final FileControl< G, A, R >  fileControl,
@NotNull final Component  mainView 
)

Create a new instance that tracks the map state.

Parameters
imageCreator2the image creator to forwards actions to
mapManagerthe map manager
mapViewsManagerthe map views manager
mapViewManagerthe map view manager
fileControlthe file control to forward actions to
mainViewthe main view component

Definition at line 212 of file MapFileActions.java.

References net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addMapModelListener(), net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.fileControl, 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.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.imageCreator2, net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mainView, net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapManager, net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapViewsManager, and net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updateActions().

+ Here is the call graph for this function:

Member Function Documentation

◆ closeMap()

void net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.closeMap ( )

Invoked when the user wants to close the map.

Definition at line 320 of file MapFileActions.java.

References net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doCloseMap().

+ Here is the call graph for this function:

◆ closeNotify()

◆ createImage()

void net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.createImage ( )

Invoked when the user wants to create an image file of the map.

Definition at line 303 of file MapFileActions.java.

References net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doCreateImage().

+ Here is the call graph for this function:

◆ doCloseMap()

◆ doCreateImage()

◆ doReloadMap()

boolean net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doReloadMap ( final boolean  performAction)
private

◆ doSaveMap()

◆ doSaveMapAs()

◆ reloadMap()

void net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.reloadMap ( )

Invoked when the user wants to reload the map to the previously saved state.

Definition at line 312 of file MapFileActions.java.

References net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doReloadMap().

+ Here is the call graph for this function:

◆ saveMap()

void net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.saveMap ( )

Invoked when the user wants to save the map.

Definition at line 287 of file MapFileActions.java.

References net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doSaveMap().

+ Here is the call graph for this function:

◆ saveMapAs()

void net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.saveMapAs ( )

Invoked when the user wants to save the map to a file.

Definition at line 295 of file MapFileActions.java.

References net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doSaveMapAs().

+ Here is the call graph for this function:

◆ setAction()

void net.sf.gridarta.gui.map.MapFileActions< 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 430 of file MapFileActions.java.

References net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updateActions().

+ Here is the call graph for this function:

◆ updateActions()

Member Data Documentation

◆ aCloseMap

Action net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.aCloseMap
private

The action for "close map".

Definition at line 113 of file MapFileActions.java.

◆ aCreateImage

Action net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.aCreateImage
private

The action for "create image".

Definition at line 101 of file MapFileActions.java.

◆ aReloadMap

Action net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.aReloadMap
private

The action for "reload map".

Definition at line 107 of file MapFileActions.java.

◆ aSaveMap

Action net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.aSaveMap
private

The action for "save map".

Definition at line 89 of file MapFileActions.java.

◆ aSaveMapAs

Action net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.aSaveMapAs
private

The action for "save map as".

Definition at line 95 of file MapFileActions.java.

◆ currentMapControl

◆ currentMapView

◆ fileControl

final FileControl<G, A, R> net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.fileControl
private

◆ imageCreator2

◆ mainView

◆ mapManager

◆ mapManagerListener

final MapManagerListener<G, A, R> net.sf.gridarta.gui.map.MapFileActions< 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) {
if (currentMapControl != null) {
}
currentMapControl = mapControl;
if (currentMapControl != null) {
}
}
@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 172 of file MapFileActions.java.

◆ mapModelListener

final MapModelListener<G, A, R> net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapModelListener
private

The MapModelListener which is attached to currentMapControl's map model.

Definition at line 133 of file MapFileActions.java.

◆ mapViewsManager


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