 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.mapfiles;
22 import javax.swing.Action;
23 import javax.swing.JCheckBoxMenuItem;
24 import javax.swing.JMenu;
33 import net.
sf.japi.swing.action.ActionBuilder;
34 import net.
sf.japi.swing.action.ActionBuilderFactory;
35 import net.
sf.japi.swing.action.ActionMethod;
36 import org.jetbrains.annotations.NotNull;
37 import org.jetbrains.annotations.Nullable;
49 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
161 public MapFolderTreeActions(@NotNull
final MapFolderTree<G, A, R> mapFolderTree, @NotNull
final PickmapSettings pickmapSettings, @NotNull
final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull
final String
createFolderKey, @NotNull
final String
deleteFolderKey, @NotNull
final String
confirmDeleteFolderKey, @NotNull
final String
deleteFolderNotEmptyKey) {
203 final JCheckBoxMenuItem menuItem =
new JCheckBoxMenuItem();
205 menuItem.setAction(action);
256 if (mapFolder ==
null || mapFolder.
getParent() ==
null) {
276 public void setAction(@NotNull
final Action action, @NotNull
final String
name) {
282 throw new IllegalArgumentException(
"unsupported action name: " +
name);
final PickmapSettingsListener pickmapSettingsListener
The PickmapSettingsListener attached to {}.
final String createFolderKey
The action key for "create folder".
Action aCreateFolderAction
Action for "create folder".
void setPickmapFoldersMenu(@Nullable final JMenu folderMenu)
Sets the pickmap folders menu to manage.
void createPickmapFolder()
Action callback function to create a new pickmap folder.
MapFolderTreeActions(@NotNull final MapFolderTree< G, A, R > mapFolderTree, @NotNull final PickmapSettings pickmapSettings, @NotNull final NewMapDialogFactory< G, A, R > newMapDialogFactory, @NotNull final String createFolderKey, @NotNull final String deleteFolderKey, @NotNull final String confirmDeleteFolderKey, @NotNull final String deleteFolderNotEmptyKey)
Creates a new instance.
Base package of all Gridarta classes.
final String confirmDeleteFolderKey
The dialog key for "confirm delete folder?".
Interface for event listeners that are interested in changes on {}.
Action aDeletePickmapFolder
Action called for "delete active folder".
void showNewPickmapFolderDialog(@NotNull final MapFolderTree< G, A, R > mapFolderTree, @Nullable final MapFolder< G, A, R > parent)
Shows a dialog for creating a new pickmap folder.
Reflects a game object (object on a map).
MapFolder< G, A, R > getParent()
Returns the parent folder.
void refresh()
Updates the actions' states.
Graphical User Interface of Gridarta.
final MapFolderTreeListener< G, A, R > mapFolderTreeListener
The MapFolderTreeListener which is registered to the selected pickmap.
GameObjects are the objects based on Archetypes found on maps.
String getName()
Returns the name.
static final ActionBuilder ACTION_BUILDER
Action Builder.
Interface for MapArchObjects.
final String deleteFolderKey
The action key for "delete folder".
Utility class to create NewMapDialog instances.
boolean isLocked()
Returns whether pickmaps are immutable.
final String deleteFolderNotEmptyKey
The dialog key for "folder is not empty".
final MapFolderTree< G, A, R > mapFolderTree
The model to operate on.
void addPickmapSettingsListener(@NotNull PickmapSettingsListener listener)
Adds a PickmapSettingsListener to be notified about changes.
final PickmapSettings pickmapSettings
The PickmapSettings to use.
void setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
MapFolder< G, A, R > activeMapFolder
The last known active folder.
void addModelListener(@NotNull final MapFolderTreeListener< G, A, R > listener)
Adds a MapFolderTreeListener to be informed about changes.
synchronized void removeMapFolder(@NotNull final MapFolder< G, A, R > mapFolder, final boolean deleteFile)
Removes a map folder from this model.
MapFolder< G, A, R > getActiveMapFolder()
Returns the active map folder.
void deletePickmapFolder()
Action callback function to delete the current pickmap folder.
int getPickmaps()
Returns the number of pickmaps in this folder.
JMenu folderMenu
The pickmap folders menu to update.
Encapsulates functionality related to actions for pickmap folder selection.
boolean doDeletePickmapFolder(final boolean performAction)
Executes the "delete pickmap" action.
Indicates that a folder contains sub-folders.
An action for the entry in the pickmaps folder menu.
Container for settings that affect pickmaps.
boolean doCreateFolder(final boolean performAction)
Executes the "create folder" action.
final NewMapDialogFactory< G, A, R > newMapDialogFactory
The factory for creating new pickmap folders.