Class RepairAndMaintenanceTab
java.lang.Object
mekhq.gui.campaignOptions.contents.RepairAndMaintenanceTab
Represents a tab in the campaign options UI used to configure settings related to repair and maintenance in a
campaign.
This tab is divided into two sections:
- Repair Tab: Manages options for era modifications, tech assignments, equipment quirks handling, destruction margins, and more.
- Maintenance Tab: Handles maintenance settings such as cycle frequency, quality standards, planetary modifiers, and unofficial maintenance rules.
The class interacts with CampaignOptions, enabling the retrieval, storage,
and application of repair and maintenance configuration settings.
-
Constructor Summary
ConstructorsConstructorDescriptionRepairAndMaintenanceTab(CampaignOptions campaignOptions) Constructs aRepairAndMaintenanceTabinstance for configuring repair and maintenance-related settings. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyCampaignOptionsToCampaign(CampaignOptions presetCampaignOptions) Applies the current tab's repair and maintenance settings from the UI components to the providedCampaignOptions.Creates the panel for the Maintenance Tab.Creates the panel for the Repair Tab.voidLoads the repair and maintenance settings from the defaultCampaignOptionsinto the tab's UI components.voidloadValuesFromCampaignOptions(CampaignOptions presetCampaignOptions) Loads the repair and maintenance settings from theCampaignOptionsobject into the tab's UI components.
-
Constructor Details
-
RepairAndMaintenanceTab
Constructs aRepairAndMaintenanceTabinstance for configuring repair and maintenance-related settings.- Parameters:
campaignOptions- theCampaignOptionsobject to be used for managing repair and maintenance options.
-
-
Method Details
-
createRepairTab
Creates the panel for the Repair Tab.This tab provides configurable options for managing repair rules, handling quirks, setting margins for equipment survival, and incorporating era modifications.
- Returns:
- a
JPanelrepresenting the Repair Tab.
-
createMaintenanceTab
Creates the panel for the Maintenance Tab.This tab provides configurable options for managing maintenance cycles, quality standards, planetary effects, and custom rules for units' upkeep.
- Returns:
- a
JPanelrepresenting the Maintenance Tab.
-
applyCampaignOptionsToCampaign
Applies the current tab's repair and maintenance settings from the UI components to the providedCampaignOptions.If no custom
CampaignOptionsare provided, uses the defaultCampaignOptionsassociated with this tab.- Parameters:
presetCampaignOptions- optional customCampaignOptionsobject to apply the current settings to. Ifnull, the default options are modified.
-
loadValuesFromCampaignOptions
public void loadValuesFromCampaignOptions()Loads the repair and maintenance settings from the defaultCampaignOptionsinto the tab's UI components. -
loadValuesFromCampaignOptions
Loads the repair and maintenance settings from theCampaignOptionsobject into the tab's UI components.If no custom
CampaignOptionsare provided, the defaultCampaignOptionsassociated with this tab is used.- Parameters:
presetCampaignOptions- optional customCampaignOptionsobject to load settings from. Ifnull, the default options are used.
-