Class CampaignOptionsCheckBox

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

public class CampaignOptionsCheckBox extends JCheckBox
A specialized JCheckBox used in the campaign options dialog.

This check box's text and tooltip are dynamically loaded from a resource bundle based on a given name. The tooltip can optionally include word wrapping with a configurable wrap size.

The checkbox also supports font scaling adjustments.

See Also:
  • Constructor Details

    • CampaignOptionsCheckBox

      public CampaignOptionsCheckBox(@Nonnull String name)
      Constructs a new instance of CampaignOptionsCheckBox with the specified name.

      The name is used to determine the checkbox's visible text and tooltip, as well as to generate its unique internal name.

      The text is located in the resource bundle key "lbl" + name + ".text". The tooltip is located in the resource bundle key "lbl" + name + ".tooltip".

      A default wrap size is used for the tooltip text if CampaignOptionsUtilities.processWrapSize(java.lang.Integer) is not overridden.

      Parameters:
      name - the name used to fetch the checkbox's text and tooltip, and to set its name
    • CampaignOptionsCheckBox

      public CampaignOptionsCheckBox(@Nonnull String name, @Nullable Integer customWrapSize)
      Constructs a new instance of CampaignOptionsCheckBox with the specified name and a custom tooltip wrap size.

      The name is used to determine the checkbox's visible text and tooltip, as well as to generate its unique internal name. The text and tooltip are fetched from the resource bundle, located at keys "lbl" + name + ".text" and "lbl" + name + ".tooltip" respectively.

      If a custom wrap size is provided, the tooltip text will be word-wrapped accordingly. If customWrapSize is null, a default wrap size is used.

      Parameters:
      name - the name used to fetch the checkbox's text and tooltip, and to set its name
      customWrapSize - the maximum number of characters per tooltip line, or null for the default wrap size
    • CampaignOptionsCheckBox

      public CampaignOptionsCheckBox(@Nonnull String name, @Nullable CampaignOptionsMetadata metadata)
      Constructs a new instance of CampaignOptionsCheckBox with the specified name and metadata.

      The metadata is used to display version badges and special flag symbols alongside the checkbox text.

      Parameters:
      name - the name used to fetch the checkbox's text and tooltip, and to set its name
      metadata - version and flag metadata for displaying badges, or null for no badges
    • CampaignOptionsCheckBox

      public CampaignOptionsCheckBox(@Nonnull String name, @Nullable Integer customWrapSize, @Nullable CampaignOptionsMetadata metadata)
      Constructs a new instance of CampaignOptionsCheckBox with the specified name, custom tooltip wrap size, and metadata.

      The name is used to determine the checkbox's visible text and tooltip, as well as to generate its unique internal name. The text and tooltip are fetched from the resource bundle, located at keys "lbl" + name + ".text" and "lbl" + name + ".tooltip" respectively.

      If a custom wrap size is provided, the tooltip text will be word-wrapped accordingly. If customWrapSize is null, a default wrap size is used.

      The metadata is used to display version badges and special flag symbols alongside the checkbox text.

      Parameters:
      name - the name used to fetch the checkbox's text and tooltip, and to set its name
      customWrapSize - the maximum number of characters per tooltip line, or null for the default wrap size
      metadata - version and flag metadata for displaying badges, or null for no badges
    • CampaignOptionsCheckBox

      public CampaignOptionsCheckBox(@Nonnull String resourceBundleName, @Nonnull String name)
      Generic constructor for reuse outside Campaign Options. Resolves the text and tooltip from name + ".text" and name + ".tooltip" in the given resource bundle, without the Campaign Options "lbl" key prefix.
      Parameters:
      resourceBundleName - the resource bundle to resolve the text and tooltip from
      name - the resource key base and internal name (no "lbl" prefix is added)
    • CampaignOptionsCheckBox

      public CampaignOptionsCheckBox(@Nonnull String resourceBundleName, @Nonnull String name, @Nullable CampaignOptionsMetadata metadata)
      Generic constructor for reuse outside Campaign Options, with option badges. Resolves the text and tooltip from name + ".text" and name + ".tooltip" (or name + ".toolTipText") in the given resource bundle, without the Campaign Options "lbl" key prefix, and appends the badge symbols for metadata (for example the "important information" flag) after the text.
      Parameters:
      resourceBundleName - the resource bundle to resolve the text and tooltip from
      name - the resource key base and internal name (no "lbl" prefix is added)
      metadata - the option's badge metadata, or null for no badges