Class AbstractMHQNagDialog

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

@Deprecated(since="0.50.05", forRemoval=true) public abstract class AbstractMHQNagDialog extends JDialog
Deprecated, for removal: This API element is subject to removal in a future version.
An abstract base class for displaying a nag dialog within MekHQ.

This dialog is used to show certain informational or warning messages during a campaign, with the option for users to ignore future messages of the same type. It includes visual elements for presenting a speaker image, description, and some configurable details, along with buttons and a checkbox for user input.

Extending this class allows customization of the dialog’s behavior and content, while maintaining a consistent design across the application.

Features:
  • Displays a two-panel layout with speaker details and a message.
  • Allows users to advance to the next day or cancel, optionally ignoring future warnings.
  • Localized using resource bundles.
See Also:
  • Field Details

    • resources

      protected final transient ResourceBundle resources
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • AbstractMHQNagDialog

      public AbstractMHQNagDialog(Campaign campaign, String nagKey)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs an AbstractMHQNagDialog with the provided campaign and nag key.
      Parameters:
      campaign - The current campaign, used to determine speaker details and other contextual data.
      nagKey - A unique key to identify this nag dialog for tracking ignore preferences.
  • Method Details

    • showDialog

      public void showDialog()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Displays the dialog to the user and waits for a response.

      This method makes the dialog visible and halts further execution until the user either dismisses or interacts with the dialog (e.g., clicks a button).

    • setRightDescriptionMessage

      public void setRightDescriptionMessage(String rightDescriptionMessage)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Updates the message displayed in the right-hand panel of the dialog.

      This method updates the content dynamically and repaints the dialog to reflect changes immediately.

      Parameters:
      rightDescriptionMessage - The message to display, expected to be a valid HTML string.
    • wasAdvanceDayCanceled

      public boolean wasAdvanceDayCanceled()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if the user selected the "Advance Day" action.

      This result is set when the user interacts with the dialog’s buttons, either advancing to the next day or cancelling the dialog. This value will be true if the "Advance Day" button was selected, otherwise false.

      Returns:
      true if "Advance Day" was canceled, otherwise false.