Class NatoIconPicker

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class NatoIconPicker extends JPanel
Palette panel that displays NATO military symbols in a compact table and supports drag-and-drop placement onto a map canvas.

Layout

The panel shows one symbol category per row. The first column contains the category name (e.g. "Infantry", "Armor"); the remaining four columns show the Friendly, Hostile, Neutral, and Unknown affiliation icons for that category. Any icon cell can be dragged onto a MapContainer to place the corresponding symbol on the map.

Drag-and-drop

Drag support is managed by a PaletteDragSupport instance created in the constructor. NatoIconPicker is responsible only for:

  1. Deciding whether the drag origin is on a draggable icon cell and, if so, building the MilSymbolTransferable payload.
  2. Clearing the table selection when the drag ends (PaletteDragSupport.PaletteDragSource.onDragEnd()).

All Swing DnD ceremony — gesture recognition, drag image display, cursor management, and end-of-drag cleanup — is handled by PaletteDragSupport.

Icon resources

Icons are loaded at construction time from the classpath under <MDI_RESOURCE_PATH>/images/nato_icons/<category>/<affiliation>.png. Both IDE and JAR execution are supported via the JAR filesystem fallback in loadIconData(javax.swing.table.DefaultTableModel).

See Also:
  • Constructor Details

    • NatoIconPicker

      public NatoIconPicker()
      Creates the NATO symbol picker, loads icon data, installs drag-and-drop support, and sizes the panel compactly to its actual contents.