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

Manages the recent menu entries. More...

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

Public Member Functions

void initRecent ()
 Initializes the recent state. More...
 
 MapMenuManager (@NotNull final MapMenu mapMenu, @NotNull final MapViewsManager<?, ?, ?> mapViewsManager, @NotNull final FileControl<?, ?, ?> fileControl, @NotNull final MapImageCache<?, ?, ?> mapImageCache)
 Create a new instance. More...
 
void setMenu (@Nullable final JMenu recentMenu)
 Sets the menu to update. More...
 

Private Member Functions

void updateMenu (@NotNull final JMenu menu, @NotNull final TreeNode root)
 Updates a JMenu from a menu instance. More...
 

Private Attributes

final ActionFactory actionFactory
 The ActionFactory for creating MapMenuActions. More...
 
final MapMenu mapMenu
 The MapMenu to use. More...
 
final PopupMenuListener popupMenuListener
 The PopupMenuListener for updating recentMenu when it opens. More...
 
JMenu recentMenu
 The menu to update. More...
 

Detailed Description

Manages the recent menu entries.

Author
Andreas Kirschbaum

Definition at line 41 of file MapMenuManager.java.

Constructor & Destructor Documentation

◆ MapMenuManager()

net.sf.gridarta.gui.mapmenu.MapMenuManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.MapMenuManager ( @NotNull final MapMenu  mapMenu,
@NotNull final MapViewsManager<?, ?, ?>  mapViewsManager,
@NotNull final FileControl<?, ?, ?>  fileControl,
@NotNull final MapImageCache<?, ?, ?>  mapImageCache 
)

Create a new instance.

Parameters
mapMenuthe map menu to use
mapViewsManagerthe map views manager for opening map files
fileControlthe file control for reporting errors
mapImageCachethe map image cache to query

Definition at line 97 of file MapMenuManager.java.

References net.sf.gridarta.gui.mapmenu.MapMenuManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapMenu.

Member Function Documentation

◆ initRecent()

void net.sf.gridarta.gui.mapmenu.MapMenuManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.initRecent ( )

Initializes the recent state.

Definition at line 119 of file MapMenuManager.java.

References net.sf.gridarta.gui.mapmenu.MapMenu.load().

+ Here is the call graph for this function:

◆ setMenu()

void net.sf.gridarta.gui.mapmenu.MapMenuManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setMenu ( @Nullable final JMenu  recentMenu)

◆ updateMenu()

void net.sf.gridarta.gui.mapmenu.MapMenuManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updateMenu ( @NotNull final JMenu  menu,
@NotNull final TreeNode  root 
)
private

Updates a JMenu from a menu instance.

Parameters
menuthe menu to update
rootthe menu instance to update from

Definition at line 128 of file MapMenuManager.java.

References net.sf.gridarta.gui.mapmenu.ActionFactory.begin(), net.sf.gridarta.gui.mapmenu.ActionFactory.end(), net.sf.gridarta.gui.mapmenu.ActionFactory.getAction(), and net.sf.gridarta.gui.utils.MenuUtils.removeAllFromSeparator().

+ Here is the call graph for this function:

Member Data Documentation

◆ actionFactory

final ActionFactory net.sf.gridarta.gui.mapmenu.MapMenuManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.actionFactory
private

The ActionFactory for creating MapMenuActions.

Definition at line 61 of file MapMenuManager.java.

◆ mapMenu

◆ popupMenuListener

final PopupMenuListener net.sf.gridarta.gui.mapmenu.MapMenuManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.popupMenuListener
private
Initial value:
= new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(final PopupMenuEvent e) {
final TreeNode treeNode = mapMenu.getRoot();
if (recentMenu != null) {
updateMenu(recentMenu, treeNode);
}
}
@Override
public void popupMenuWillBecomeInvisible(final PopupMenuEvent e) {
}
@Override
public void popupMenuCanceled(final PopupMenuEvent e) {
}
}

The PopupMenuListener for updating recentMenu when it opens.

Definition at line 68 of file MapMenuManager.java.

◆ recentMenu


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