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

Maintains (dialog) instance associated to map view instances. More...

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

Public Member Functions

void disposeDialog (final MapView< G, A, R > mapView)
 Dispose a dialog. More...
 
void showDialog (final MapView< G, A, R > mapView)
 Show a dialog for positioning the cursor of a map. More...
 

Protected Member Functions

 AbstractPerMapDialogManager (@NotNull final MapViewManager< G, A, R > mapViewManager)
 Creates a new instance. More...
 
abstract void activate (@NotNull D dialog)
 Activates an existing instance. More...
 
abstract D allocate (@NotNull MapView< G, A, R > mapView)
 Creates a new instance. More...
 
abstract void dispose (@NotNull D dialog)
 Destroys an instance. More...
 

Private Attributes

final Map< MapView< G, A, R >, D > dialogs = new HashMap<>()
 Dialog for each map view. More...
 
final MapViewManagerListener< G, A, R > mapViewManagerListener
 The map view manager listener to detect closed map views. More...
 

Detailed Description

Maintains (dialog) instance associated to map view instances.

This class makes sure that for each map view no more than one go location dialog exists.

Author
Andreas Kirschbaum

Definition at line 39 of file AbstractPerMapDialogManager.java.

Constructor & Destructor Documentation

◆ AbstractPerMapDialogManager()

net.sf.gridarta.gui.map.AbstractPerMapDialogManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, D >.AbstractPerMapDialogManager ( @NotNull final MapViewManager< G, A, R >  mapViewManager)
protected

Creates a new instance.

Parameters
mapViewManagerthe view map manager

Definition at line 72 of file AbstractPerMapDialogManager.java.

Member Function Documentation

◆ activate()

abstract void net.sf.gridarta.gui.map.AbstractPerMapDialogManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, D >.activate ( @NotNull D  dialog)
abstractprotected

Activates an existing instance.

Parameters
dialogthe instance

Referenced by net.sf.gridarta.gui.map.AbstractPerMapDialogManager< G, A, R, net.sf.gridarta.gui.dialog.golocation.GoLocationDialog< G, A, R > >.showDialog().

+ Here is the caller graph for this function:

◆ allocate()

abstract D net.sf.gridarta.gui.map.AbstractPerMapDialogManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, D >.allocate ( @NotNull MapView< G, A, R >  mapView)
abstractprotected

◆ dispose()

abstract void net.sf.gridarta.gui.map.AbstractPerMapDialogManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, D >.dispose ( @NotNull D  dialog)
abstractprotected

Destroys an instance.

Parameters
dialogthe instance

Referenced by net.sf.gridarta.gui.map.AbstractPerMapDialogManager< G, A, R, net.sf.gridarta.gui.dialog.golocation.GoLocationDialog< G, A, R > >.disposeDialog().

+ Here is the caller graph for this function:

◆ disposeDialog()

void net.sf.gridarta.gui.map.AbstractPerMapDialogManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, D >.disposeDialog ( final MapView< G, A, R >  mapView)

Dispose a dialog.

Parameters
mapViewthe map view to dispose the dialog of; do nothing if no dialog exists

Definition at line 98 of file AbstractPerMapDialogManager.java.

Referenced by net.sf.gridarta.gui.dialog.golocation.GoLocationDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setValue().

+ Here is the caller graph for this function:

◆ showDialog()

void net.sf.gridarta.gui.map.AbstractPerMapDialogManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, D >.showDialog ( final MapView< G, A, R >  mapView)

Show a dialog for positioning the cursor of a map.

Parameters
mapViewthe view map for cursor positioning

Definition at line 80 of file AbstractPerMapDialogManager.java.

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ dialogs

◆ mapViewManagerListener

final MapViewManagerListener<G, A, R> net.sf.gridarta.gui.map.AbstractPerMapDialogManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, D >.mapViewManagerListener
private
Initial value:
= new MapViewManagerListener<G, A, R>() {
@Override
public void activeMapViewChanged(@Nullable final MapView<G, A, R> mapView) {
}
@Override
public void mapViewCreated(@NotNull final MapView<G, A, R> mapView) {
}
@Override
public void mapViewClosing(@NotNull final MapView<G, A, R> mapView) {
disposeDialog(mapView);
}
}

The map view manager listener to detect closed map views.

Definition at line 49 of file AbstractPerMapDialogManager.java.

Referenced by net.sf.gridarta.gui.map.AbstractPerMapDialogManager< G, A, R, net.sf.gridarta.gui.dialog.golocation.GoLocationDialog< G, A, R > >.AbstractPerMapDialogManager().


The documentation for this class was generated from the following file:
net.sf.gridarta.gui.map.AbstractPerMapDialogManager.disposeDialog
void disposeDialog(final MapView< G, A, R > mapView)
Dispose a dialog.
Definition: AbstractPerMapDialogManager.java:98