Class ContractEditorDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ContractEditorDialog extends JDialog
A GM-only editor for a single AbstractContract market offer. It surfaces essentially every field a game master would want to hand-tune - identity, board parameters, schedule, target system, employer and enemy make-up (including camouflage and force colour), terms, objectives, pay, rented facilities, and morale - so an offer can be reshaped to their specifications. Faction and system fields are pickers rather than free text to prevent typos.

The generated NPC personnel attached to a contract (the employer's negotiator and liaison, and the opposing commander) can have their name, rank, and portrait edited. On confirmation the contract is mutated in place; query wasConfirmed() afterward and rebuild any view showing it. The player's chosen negotiator and the StratCon campaign state are preserved as-is, not edited here.

Since:
0.51.01
See Also:
  • Constructor Details

    • ContractEditorDialog

      public ContractEditorDialog(Campaign campaign, AbstractContract contract)
      Opens the modal GM editor for an existing offer. On confirmation the contract's fields are updated in place; query wasConfirmed() afterward.
      Parameters:
      campaign - the active campaign
      contract - the offer to edit
      Since:
      0.51.01
    • ContractEditorDialog

      public ContractEditorDialog(Campaign campaign, AbstractContract contract, @Nullable ContractSearchType createBucket)
      Opens the modal GM editor. Passing a non-null createBucket puts the dialog in "create" mode: the title and header eyebrow change and a market-bucket picker (seeded to createBucket) is shown, letting the GM choose which ContractSearchType the new offer belongs to (read back via getSelectedSearchType()).

      In both modes the given contract is mutated in place; in create mode the caller is expected to build a blank contract (see NewContractFactory) and add it to the chosen bucket when wasConfirmed() is true.

      Parameters:
      campaign - the active campaign
      contract - the contract to edit (a blank one, for create mode)
      createBucket - the market bucket to seed the picker with, or null for edit mode
      Since:
      0.51.01
  • Method Details

    • getSelectedSearchType

      public ContractSearchType getSelectedSearchType()
      Returns:
      in create mode, the market bucket the GM selected for the new offer; in edit mode, null
      Since:
      0.51.01
    • wasConfirmed

      public boolean wasConfirmed()
      Returns:
      whether the GM confirmed their edits.