Class AssignUnitToForceMenu

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, MenuElement, SwingConstants

public class AssignUnitToForceMenu extends JScrollableMenu
A dynamic, scrollable menu for assigning one or more Unit objects to forces within a Campaign's TOE structure.

This menu provides:

  • A "clear assignment" option that moves units to Force.FORCE_NONE
  • A hierarchical tree of all forces descending from Force.FORCE_ORIGIN
  • Per-force assignment actions for each force in the hierarchy

The menu is built only when all selected units are valid for assignment. Invalid inputs—such as unavailable units, units with null entities, or units with unsupported entity types—cause the menu to short-circuit and display nothing.

Since:
0.50.10
See Also:
  • Constructor Details

    • AssignUnitToForceMenu

      public AssignUnitToForceMenu(Campaign campaign, Unit... units)
      Constructs a new AssignUnitToForceMenu and initializes all force assignment options based on the given campaign and units.
      Parameters:
      campaign - the campaign whose forces are being modified
      units - the units eligible for force reassignment
      Since:
      0.50.10