Gridarta Editor
PickmapChooserControl.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2015 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.gui.panel.pickmapchooser;
21 
22 import java.awt.Component;
23 import java.io.File;
24 import java.io.IOException;
25 import java.util.Collection;
26 import java.util.Collections;
27 import java.util.HashSet;
28 import java.util.List;
29 import java.util.Set;
30 import javax.swing.Action;
31 import javax.swing.JOptionPane;
32 import javax.swing.JPopupMenu;
33 import javax.swing.event.ChangeEvent;
34 import javax.swing.event.ChangeListener;
59 import net.sf.gridarta.utils.Size2D;
60 import net.sf.japi.swing.action.ActionBuilder;
61 import net.sf.japi.swing.action.ActionBuilderFactory;
62 import net.sf.japi.swing.action.ActionMethod;
63 import org.apache.log4j.Category;
64 import org.apache.log4j.Logger;
65 import org.jetbrains.annotations.NotNull;
66 import org.jetbrains.annotations.Nullable;
67 
74 public class PickmapChooserControl<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> implements EditorAction, ObjectChooserTab<G, A, R> {
75 
79  @NotNull
80  private static final Category LOG = Logger.getLogger(PickmapChooserControl.class);
81 
85  @NotNull
86  private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta");
87 
91  @NotNull
93 
97  @NotNull
99 
103  @NotNull
105 
109  @NotNull
111 
115  @NotNull
117 
121  @NotNull
123 
127  @NotNull
129 
133  @Nullable
134  private Action aAddNewPickmap;
135 
139  @Nullable
140  private Action aOpenPickmapMap;
141 
145  @Nullable
146  private Action aDeletePickmap;
147 
151  @Nullable
152  private Action aSavePickmap;
153 
157  @Nullable
158  private Action aRevertPickmap;
159 
163  @NotNull
164  private final Component parent;
165 
169  @Nullable
171 
175  @Nullable
177 
181  private boolean active;
182 
186  @NotNull
188 
189  @Override
190  public void saved(@NotNull final DefaultMapControl<G, A, R> mapControl) {
191  /*
192  * If we open a pickmap in the editor, is handled as normal map.
193  * to find out its original a pickmap we check the file name.
194  */
195  reloadPickmap(mapControl.getMapModel().getMapFile().getFile());
196  }
197 
198  };
199 
204  @NotNull
206 
207  @Override
208  public void mapSizeChanged(@NotNull final Size2D newSize) {
209  // ignore
210  }
211 
212  @Override
213  public void mapSquaresChanged(@NotNull final Set<MapSquare<G, A, R>> mapSquares) {
214  // ignore
215  }
216 
217  @Override
218  public void mapObjectsChanged(@NotNull final Set<G> gameObjects, @NotNull final Set<G> transientGameObjects) {
219  // ignore
220  }
221 
222  @Override
223  public void errorsChanged(@NotNull final ErrorCollector<G, A, R> errors) {
224  // ignore
225  }
226 
227  @Override
228  public void mapFileChanged(@Nullable final MapFile oldMapFile) {
229  // ignore
230  }
231 
232  @Override
233  public void modifiedChanged() {
234  refresh();
235  }
236 
237  };
238 
242  @NotNull
244 
245  @Override
246  public void activePickmapChanged(@Nullable final PickmapState<G, A, R> pickmapState) {
247  setCurrentPickmap(pickmapState);
248  }
249 
250  @Override
251  public void pickmapReverted(@NotNull final PickmapState<G, A, R> pickmapState) {
252  setCurrentPickmap(pickmapState);
253  }
254 
255  @Override
256  public void pickmapModifiedChanged(final int index, @NotNull final PickmapState<G, A, R> pickmapState) {
257  // ignore
258  }
259 
260  };
261 
265  @NotNull
266  private final ChangeListener changeListener = new ChangeListener() {
267 
268  @Override
269  public void stateChanged(final ChangeEvent e) {
270  final PickmapState<G, A, R> pickmapState = getSelectedPickmap();
271  final MapControl<G, A, R> mapControl = pickmapState == null ? null : pickmapState.getPickmap();
272  if (mapControl != null) {
273  mapViewsManager.getMapViewFrame(mapControl).getMapCursor().deactivate();
274  }
275  pickmapChooserModel.fireActivePickmapChanged(pickmapState);
276  }
277 
278  };
279 
283  @NotNull
285 
286  @Override
287  public void currentMapChanged(@Nullable final MapControl<G, A, R> mapControl) {
288  // ignore
289  }
290 
291  @Override
292  public void mapCreated(@NotNull final MapControl<G, A, R> mapControl, final boolean interactive) {
293  if (!mapControl.isPickmap()) {
294  mapControl.addMapControlListener(mapControlListener);
295  }
296  }
297 
298  @Override
299  public void mapClosing(@NotNull final MapControl<G, A, R> mapControl) {
300  // ignore
301  }
302 
303  @Override
304  public void mapClosed(@NotNull final MapControl<G, A, R> mapControl) {
305  if (!mapControl.isPickmap()) {
306  mapControl.removeMapControlListener(mapControlListener);
307  }
308  }
309 
310  };
311 
316  @NotNull
318 
319  @Override
320  public void lockedChanged(final boolean locked) {
321  refresh();
322  }
323 
324  };
325 
338  public PickmapChooserControl(@NotNull final PickmapChooserModel<G, A, R> pickmapChooserModel, @NotNull final PickmapSettings pickmapSettings, @NotNull final NewMapDialogFactory<G, A, R> newMapDialogFactory, @NotNull final MapFolderTree<G, A, R> mapFolderTree, @NotNull final MapManager<G, A, R> mapManager, @NotNull final Component parent, @NotNull final MapViewsManager<G, A, R> mapViewsManager, @NotNull final FileControl<G, A, R> fileControl, @NotNull final PickmapChooserView<G, A, R> pickmapChooserView) {
339  this.pickmapChooserModel = pickmapChooserModel;
340  this.pickmapSettings = pickmapSettings;
341  this.mapFolderTree = mapFolderTree;
342  this.parent = parent;
343  this.newMapDialogFactory = newMapDialogFactory;
344  this.mapViewsManager = mapViewsManager;
345  this.fileControl = fileControl;
346  ACTION_BUILDER.createToggles(true, this, "lockAllPickmaps");
347  pickmapChooserModel.addPickmapChooserListener(pickmapChooserModelListener);
348  view = pickmapChooserView;
349  refresh();
350  view.addChangeListener(changeListener);
351  mapManager.addMapManagerListener(mapManagerListener);
352  pickmapSettings.addPickmapSettingsListener(pickmapSettingsListener);
353  }
354 
359  public void setPopupMenu(@NotNull final JPopupMenu popupMenu) {
360  view.setPopupMenu(popupMenu);
361  }
362 
367  private void reloadPickmap(@NotNull final File file) {
368  final PickmapState<G, A, R> pickmapState = pickmapChooserModel.getPickmap(file);
369  if (pickmapState != null) {
370  try {
371  pickmapState.revert();
372  } catch (final IOException ex) {
373  LOG.warn("cannot reload pickmap " + pickmapState.getFile() + ": " + ex.getMessage());
374  }
375  }
376  }
377 
382  @ActionMethod
383  public boolean isLockAllPickmaps() {
384  return pickmapSettings.isLocked();
385  }
386 
387  @Nullable
388  @Override
389  public G getSelection() {
391  if (pickmap == null) {
392  return null;
393  }
394 
395  final MapView<G, A, R> mapView = mapViewsManager.getMapViewFrame(pickmap);
396  return mapView == null ? null : mapView.getSelectedGameObject();
397  }
398 
403  public boolean canExit() {
404  final Collection<MapControl<G, A, R>> unsavedPickmaps = new HashSet<>();
405  mapFolderTree.getUnsavedPickmaps(unsavedPickmaps);
406  for (final MapControl<G, A, R> pickmap : unsavedPickmaps) {
407  final int result = ACTION_BUILDER.showConfirmDialog(parent, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, "pickmapConfirmSaveChanges", pickmap.getMapModel().getMapArchObject().getMapName());
408  if (result == JOptionPane.YES_OPTION) {
409  try {
410  pickmap.save();
411  } catch (final IOException e) {
412  ACTION_BUILDER.showMessageDialog(parent, "encodeMapFile", pickmap.getMapModel().getMapFile(), e.getMessage());
413  return false;
414  }
415  if (pickmap.getMapModel().isModified()) {
416  return false;
417  }
418  } else if (result == JOptionPane.CANCEL_OPTION || result == JOptionPane.CLOSED_OPTION) {
419  return false;
420  }
421  }
422  return true;
423  }
424 
429  @Nullable
431  final int selectedIndex = view.getSelectedIndex();
432  if (selectedIndex == -1) {
433  return null;
434  }
435  try {
436  return pickmapChooserModel.get(selectedIndex);
437  } catch (final IndexOutOfBoundsException ignored) {
438  return null;
439  }
440  }
441 
442  @NotNull
443  @Override
444  public Component getComponent() {
445  return view.getPickmapPanel();
446  }
447 
448  @Override
449  public void setActive(final boolean active) {
450  if (this.active == active) {
451  return;
452  }
453 
454  this.active = active;
455  refresh();
456  }
457 
458  @Override
459  public boolean isMatching(@NotNull final G gameObject) {
460  for (final G selection : getSelections()) {
461  if (gameObject.isEqual(selection)) {
462  return true;
463  }
464  }
465  return false;
466  }
467 
468  @NotNull
469  @Override
470  public List<G> getSelections() {
472  if (pickmap == null) {
473  return Collections.emptyList();
474  }
475 
476  final MapView<G, A, R> mapView = mapViewsManager.getMapViewFrame(pickmap);
477  return mapView == null ? Collections.emptyList() : mapView.getSelectedGameObjects();
478  }
479 
480  @NotNull
481  @Override
482  public String getTitle() {
483  return ActionBuilderUtils.getString(ACTION_BUILDER, "objectChooser.pickmapsTabTitle");
484  }
485 
489  @ActionMethod
490  public void addNewPickmap() {
491  doAddNewPickmap(true);
492  }
493 
497  @ActionMethod
498  public void openPickmapMap() {
499  doOpenPickmapMap(true);
500  }
501 
505  @ActionMethod
506  public void deletePickmap() {
507  doDeletePickmap(true);
508  }
509 
513  @ActionMethod
514  public void savePickmap() {
515  doSavePickmap(true);
516  }
517 
522  @ActionMethod
523  public void revertPickmap() {
524  doRevertPickmap(true);
525  }
526 
532  @Nullable
534  if (pickmapSettings.isLocked() || !active) {
535  return null;
536  }
537  return currentPickmapState;
538  }
539 
544  private void setCurrentPickmap(@Nullable final PickmapState<G, A, R> currentPickmapState) {
545  final MapControl<G, A, R> pickmapControl = currentPickmapState == null ? null : currentPickmapState.getPickmap();
546  if (this.currentPickmapState == currentPickmapState && currentPickmapControl == pickmapControl) {
547  return;
548  }
549 
550  if (currentPickmapControl != null) {
551  currentPickmapControl.removeMapControlListener(mapControlListener);
552  currentPickmapControl.getMapModel().removeMapModelListener(mapModelListener);
553  }
554 
555  this.currentPickmapState = currentPickmapState;
556  currentPickmapControl = pickmapControl;
557 
558  if (currentPickmapControl != null) {
559  currentPickmapControl.addMapControlListener(mapControlListener);
560  currentPickmapControl.getMapModel().addMapModelListener(mapModelListener);
561  }
562 
563  refresh();
564  }
565 
570  @ActionMethod
571  public void setLockAllPickmaps(final boolean lockAllPickmaps) {
572  pickmapSettings.setLocked(lockAllPickmaps);
573  }
574 
578  private void refresh() {
579  if (aAddNewPickmap != null) {
580  //noinspection ConstantConditions
581  aAddNewPickmap.setEnabled(doAddNewPickmap(false));
582  }
583  if (aOpenPickmapMap != null) {
584  //noinspection ConstantConditions
585  aOpenPickmapMap.setEnabled(doOpenPickmapMap(false));
586  }
587  if (aDeletePickmap != null) {
588  //noinspection ConstantConditions
589  aDeletePickmap.setEnabled(doDeletePickmap(false));
590  }
591  if (aSavePickmap != null) {
592  //noinspection ConstantConditions
593  aSavePickmap.setEnabled(doSavePickmap(false));
594  }
595  if (aRevertPickmap != null) {
596  //noinspection ConstantConditions
597  aRevertPickmap.setEnabled(doRevertPickmap(false));
598  }
599  }
600 
606  private boolean doAddNewPickmap(final boolean performAction) {
607  if (pickmapSettings.isLocked()) {
608  return false;
609  }
610 
611  if (performAction) {
612  newMapDialogFactory.showNewPickmapDialog();
613  }
614 
615  return true;
616  }
617 
623  private boolean doOpenPickmapMap(final boolean performAction) {
624  final PickmapState<G, A, R> pickmapState = getOpenPickmapMap();
625  if (pickmapState == null) {
626  return false;
627  }
628 
629  if (performAction) {
630  final File file = pickmapState.getFile();
631  try {
632  mapViewsManager.openMapFileWithView(file, null, null);
633  } catch (final IOException ex) {
634  fileControl.reportLoadError(file, ex.getMessage());
635  return false;
636  }
637  }
638 
639  return true;
640  }
641 
647  private boolean doDeletePickmap(final boolean performAction) {
648  if (pickmapSettings.isLocked() || !active) {
649  return false;
650  }
651 
652  final PickmapState<G, A, R> pickmapState = currentPickmapState;
653  if (pickmapState == null) {
654  return false;
655  }
656 
657  if (performAction) {
658  if (!ACTION_BUILDER.showQuestionDialog(parent, "confirmDeletePickmap", pickmapState.getFile().getName())) {
659  return false;
660  }
661 
662  pickmapState.remove(true);
663  }
664 
665  return true;
666  }
667 
673  private boolean doSavePickmap(final boolean performAction) {
674  if (pickmapSettings.isLocked() || !active) {
675  return false;
676  }
677 
678  if (currentPickmapState == null || currentPickmapControl == null || !currentPickmapControl.getMapModel().isModified()) {
679  return false;
680  }
681 
682  final PickmapState<G, A, R> pickmapState = currentPickmapState;
683  if (pickmapState == null) {
684  return false;
685  }
686 
687  if (performAction) {
688  try {
689  pickmapState.save();
690  } catch (final IOException e) {
691  ACTION_BUILDER.showMessageDialog(parent, "encodeMapFile", pickmapState, e.getMessage());
692  return false;
693  }
694  }
695 
696  return true;
697  }
698 
704  private boolean doRevertPickmap(final boolean performAction) {
705  if (pickmapSettings.isLocked() || !active) {
706  return false;
707  }
708 
709  final PickmapState<G, A, R> pickmapState = currentPickmapState;
710  if (pickmapState == null) {
711  return false;
712  }
713 
714  final File mapFileFile = pickmapState.getFile();
715  if (currentPickmapControl == null || !currentPickmapControl.getMapModel().isModified() || !mapFileFile.exists()) {
716  return false;
717  }
718 
719  final MapControl<G, A, R> mapControl = pickmapState.getPickmap();
720  if (mapControl == null) {
721  return false;
722  }
723 
724  final MapModel<G, A, R> mapModel = mapControl.getMapModel();
725  final MapFile mapControlMapFile = mapModel.getMapFile();
726  if (mapControlMapFile == null) {
727  return false;
728  }
729 
730  if (performAction) {
731  if (!mapControlMapFile.getFile().exists()) {
732  ACTION_BUILDER.showMessageDialog(parent, "revertPickmapGone", mapControlMapFile);
733  return false;
734  }
735 
736  if (mapModel.isModified() && !ACTION_BUILDER.showQuestionDialog(parent, "confirmRevertPickmap", mapFileFile.getName())) {
737  return false;
738  }
739 
740  try {
741  pickmapState.revert();
742  } catch (final IOException ex) {
743  ACTION_BUILDER.showMessageDialog(null/*XXX:parent*/, "pickmapIOError", mapFileFile.getName(), ex.getMessage());
744  return false;
745  }
746  }
747 
748  return true;
749  }
750 
751  @Override
752  public void setAction(@NotNull final Action action, @NotNull final String name) {
753  if (name.equals("addNewPickmap")) {
754  aAddNewPickmap = action;
755  } else if (name.equals("openPickmapMap")) {
756  aOpenPickmapMap = action;
757  } else if (name.equals("deletePickmap")) {
758  aDeletePickmap = action;
759  } else if (name.equals("savePickmap")) {
760  aSavePickmap = action;
761  } else if (name.equals("revertPickmap")) {
762  aRevertPickmap = action;
763  } else {
764  throw new IllegalArgumentException();
765  }
766  refresh();
767  }
768 
769 }
boolean doSavePickmap(final boolean performAction)
Performs or checks availability of the "save pickmap" action.
final PickmapSettings pickmapSettings
The PickmapSettings to use.
void setLockAllPickmaps(final boolean lockAllPickmaps)
Set whether all pickmaps are locked.
Component getPickmapPanel()
Returns the JTabbedPane with all pickmaps.
Interface for event listeners that are interested in changes on PickmapSettings.
List< G > getSelections()
Returns the selected game objects.
A MapModel reflects the data of a map.
Definition: MapModel.java:75
A MapManager manages all opened maps.
Definition: MapManager.java:37
PickmapState< G, A, R > getPickmap(@NotNull final File file)
Returns the pickmap by file name.
void getUnsavedPickmaps(@NotNull final Collection< MapControl< G, A, R >> unsavedMaps)
Returns all unsaved map controls of this model.
Graphical User Interface of Gridarta.
boolean doRevertPickmap(final boolean performAction)
Performs or checks availability of the "revert pickmap" action.
Maintains the state of a pickmap file.
This package contains the framework for validating maps.
final PickmapChooserView< G, A, R > view
The view for this control.
void revert()
Reverts this pickmap to its underlying map file.
Interface for listeners listening on MapModel events.
void setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
boolean isModified()
Return whether the map has been modified from the on-disk state.
Action aDeletePickmap
Action called for "delete active pickmap".
void addChangeListener(@NotNull final ChangeListener changeListener)
Adds a ChangeListener to be notified when the selected pickmap tab changes.
void addNewPickmap()
Invoked when user wants to open a new pickmap.
void addMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Register a map listener.
final Component parent
The parent component for error messages.
void deletePickmap()
Invoked when the user wants to delete the active pickmap.
void openPickmapMap()
Open active pickmap as normal map for extensive editing.
MapModel< G, A, R > getMapModel()
Returns the map model.
boolean canExit()
Invoked when the user wants to exit the application.
PickmapState< G, A, R > getSelectedPickmap()
Returns the selected pickmap.
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
final MapManagerListener< G, A, R > mapManagerListener
The MapManagerListener to track existing pickmaps.
PickmapState< G, A, R > get(final int index)
Returns a map file by index.
void showNewPickmapDialog()
Shows a dialog for creating a new pickmap.
Base package of all Gridarta classes.
void revertPickmap()
Invoked when user wants to revert the current pickmap to previously saved state.
Reflects a game object (object on a map).
Definition: GameObject.java:36
void reportLoadError(@Nullable File file, @NotNull String message)
MapView< G, A, R > openMapFileWithView(@NotNull final MapFile mapFile, @Nullable final Point viewPosition, @Nullable final Point centerSquare)
Load a map file and create a map view.
PickmapState< G, A, R > currentPickmapState
The current active pickmap on top.
A global editor action.
PickmapChooserControl(@NotNull final PickmapChooserModel< G, A, R > pickmapChooserModel, @NotNull final PickmapSettings pickmapSettings, @NotNull final NewMapDialogFactory< G, A, R > newMapDialogFactory, @NotNull final MapFolderTree< G, A, R > mapFolderTree, @NotNull final MapManager< G, A, R > mapManager, @NotNull final Component parent, @NotNull final MapViewsManager< G, A, R > mapViewsManager, @NotNull final FileControl< G, A, R > fileControl, @NotNull final PickmapChooserView< G, A, R > pickmapChooserView)
Create a PickmapChooserControl.
void setActive(final boolean active)
Called whenever this tab becomes active or inactive.
MapControl< G, A, R > getPickmap()
Returns the MapControl representing this pickmap.
Interface for listeners listening to MapManager changes.
Component getComponent()
Returns the component to show in the object chooser.
Interface for listeners listening on changes in MapControl instances.
void reloadPickmap(@NotNull final File file)
Reload a pickmap.
GameObjects are the objects based on Archetypes found on maps.
void addMapControlListener(@NotNull MapControlListener< G, A, R > listener)
Registers a MapControlListener.
void remove(final boolean deleteFile)
Removes this pickmap from its folder.
void setPopupMenu(@NotNull final JPopupMenu popupMenu)
Sets the popup menu to show.
Base classes for rendering maps.
void setLocked(boolean locked)
Sets whether pickmaps are immutable.
List< G > getSelectedGameObjects()
Return all selected game objects.
boolean doOpenPickmapMap(final boolean performAction)
Performs or checks availability of the "open pickmap map" action.
void removeMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Unregister a map listener.
File getFile()
Returns the underlying map file.
final PickmapChooserModelListener< G, A, R > pickmapChooserModelListener
The pickmap chooser listener used to track the currently active pickmap.
Utility class to create NewMapDialog instances.
Utility class for ActionBuilder related functions.
MapView< G, A, R > getMapViewFrame(@NotNull final MapControl< G, A, R > mapControl)
Returns the last used view of a MapControl.
void fireActivePickmapChanged(@Nullable final PickmapState< G, A, R > pickmapState)
Notifies all listeners that the active pickmap has changes.
Action aSavePickmap
Action called for "save active pickmap".
Manages the pickmap panel and most pickmap-related code in general.
MapCursor< G, A, R > getMapCursor()
Returns the MapCursor of this view.
Currently nothing more than a marker interface for unification.
Definition: MapControl.java:35
A map view consists of a map grid and a map cursor, and is attached to a map control.
Definition: MapView.java:43
MapFile getMapFile()
Returns the map file.
boolean isLockAllPickmaps()
Return whether all pickmaps are locked.
File getFile()
Returns a File for this map file.
Definition: MapFile.java:102
boolean isMatching(@NotNull final G gameObject)
Returns whether the current selection matches the given game object.
boolean isLocked()
Returns whether pickmaps are immutable.
An interface for classes that collect errors.
final MapViewsManager< G, A, R > mapViewsManager
The MapViewsManager.
final FileControl< G, A, R > fileControl
The FileControl to use.
final ChangeListener changeListener
The ChangeListener attached to {link view}.
final MapControlListener< G, A, R > mapControlListener
The map control listener which is registered to the selected pickmap.
final PickmapChooserModel< G, A, R > pickmapChooserModel
The PickmapChooserModel to control.
void setCurrentPickmap(@Nullable final PickmapState< G, A, R > currentPickmapState)
Set the currently active pickmap.
G getSelectedGameObject()
Return one selected game object.
Action aOpenPickmapMap
Action called for "open active pickmap as map".
String getTitle()
Returns the title to display in the object chooser.
final NewMapDialogFactory< G, A, R > newMapDialogFactory
The factory for creating new pickmaps.
void setPopupMenu(@NotNull final JPopupMenu popupMenu)
Sets the popup menu to show.
final PickmapSettingsListener pickmapSettingsListener
The PickmapSettingsListener attached to pickmapSettings.
final void deactivate()
Cursor gets deactivated.
Definition: MapCursor.java:354
PickmapState< G, A, R > getOpenPickmapMap()
Determine if "open pickmap as map" is enabled.
boolean doDeletePickmap(final boolean performAction)
Performs or checks availability of the "delete pickmap" action.
Action aRevertPickmap
Action called for "revert active pickmap".
The location of a map file with a map directory.
Definition: MapFile.java:31
static final Category LOG
The Logger for printing log messages.
MapControl< G, A, R > currentPickmapControl
The current active pickmap on top.
Interface for classes being part of the object chooser.
Container for settings that affect pickmaps.
boolean doAddNewPickmap(final boolean performAction)
Performs or checks availability of the "add new pickmap" action.
The class Size2D represents a 2d rectangular area.
Definition: Size2D.java:30
final MapModelListener< G, A, R > mapModelListener
The MapModelListener which is registered to the selected pickmap.
void removeMapControlListener(@NotNull MapControlListener< G, A, R > listener)
Unregisters a MapControlListener.