Class MHQOptionsPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class MHQOptionsPane extends JPanel
MekHQ Client Options pane backed by the shared MegaMek settings navigation, page, search, and contextual-help framework. Option values remain owned by MHQOptionsModel and are applied to MHQOptions only when the hosting dialog confirms the edits.
See Also:
  • Constructor Details

    • MHQOptionsPane

      public MHQOptionsPane(JFrame frame)
  • Method Details

    • getPreferredSize

      public Dimension getPreferredSize()
      Floors the pane's initial size so the dialog opens at a comfortable size rather than packing tightly around the simpler MekHQ pages. Width is floored to the navigation column plus the shared page-width cap (narrower pages centre within it, as in Campaign Options); height is floored to a fixed start height. The base dialog still clamps the result to 80% of the screen, the dialog stays freely resizable, and naturally larger content still wins via Math.max.
      Overrides:
      getPreferredSize in class JComponent
    • save

      public void save()
      Writes the edited options back to MHQOptions. Called by the hosting dialog when the user confirms. Each visited page copies its controls into the shared MHQOptionsModel; a page the user never opened was never built, so its MHQOptionsPage.writeToModel() is a no-op and the model keeps the values it was built with. The fully-populated model is then applied to MHQOptions (and the shared UI and user-directory stores) in one step.