Class AbstractSplitPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public abstract class AbstractSplitPane extends JSplitPane
This is the default SplitPane. It handles preferences, resources, the frame, and setup.

Inheriting classes must call initialize() in their constructor and override createLeftComponent() and createRightComponent()

This is directly tied to MekHQ's AbstractMHQSplitPane, and any changes here MUST be verified there.

See Also:
  • Field Details

  • Constructor Details

    • AbstractSplitPane

      @Deprecated(since="0.51.0", forRemoval=true) protected AbstractSplitPane(JFrame frame, String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This creates an AbstractSplitPane using the default resource bundle. This is the normal constructor to use for an AbstractSplitPane.
    • AbstractSplitPane

      protected AbstractSplitPane(JFrame frame, ResourceBundle resources, String name)
      This creates an AbstractSplitPane using the specified resource bundle. This is not recommended by default.
  • Method Details

    • getFrame

      public JFrame getFrame()
    • setFrame

      public void setFrame(JFrame frame)
    • initialize

      protected void initialize()
      This initializes the Split Pane. It must be called by inheriting classes during their constructors
    • createLeftComponent

      protected abstract Component createLeftComponent()
      Returns:
      the created left component
    • createRightComponent

      protected abstract Component createRightComponent()
      Returns:
      the created right component
    • finalizeInitialization

      protected void finalizeInitialization() throws Exception
      This MUST be called at the end of initialization to finalize it. This is the key method for this being the abstract basis for all other split panes
      Throws:
      Exception - if there's an issue finishing initialization. Normally this means there's an issue setting the preferences, which normally means that a component has had its name value set.
    • setPreferences

      protected void setPreferences() throws Exception
      This is used to set preferences based on the preference node for this class. It is overridden for MekHQ usage
      Throws:
      Exception - if there's an issue initializing the preferences. Normally this means a component has not had its name value set.
    • setPreferences

      protected void setPreferences(PreferencesNode preferences) throws Exception
      This sets the base preferences for this class, and calls the custom preferences method
      Throws:
      Exception - if there's an issue initializing the preferences. Normally this means a component has not had its name value set.
    • setCustomPreferences

      protected void setCustomPreferences(PreferencesNode preferences) throws Exception
      Adds custom preferences to the child pane.

      By default, this pane will track preferences related to the location of the split Other preferences can be added by overriding this method.

      Parameters:
      preferences - the preference node for this pane
      Throws:
      Exception - if there's an issue initializing the preferences. Normally this means a component has not had its name value set.