Class AbstractScrollPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ScrollPaneConstants

public abstract class AbstractScrollPane extends JScrollPane
This is the default ScrollPane. It handles preferences, resources, and the frame.

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

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

See Also:
  • Field Details

  • Constructor Details

    • AbstractScrollPane

      @Deprecated(since="0.51.0", forRemoval=true) protected AbstractScrollPane(JFrame frame, String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This creates an AbstractScrollPane using the default resource bundle and using the default scrollbar policies of vertical and horizontal scrollbars as required.
    • AbstractScrollPane

      protected AbstractScrollPane(JFrame frame, String name, int verticalScrollBarPolicy, int horizontalScrollBarPolicy)
      This creates an AbstractScrollPane using the default resource bundle and using the specified scrollbar policies.
    • AbstractScrollPane

      protected AbstractScrollPane(JFrame frame, ResourceBundle resources, String name, int verticalScrollBarPolicy, int horizontalScrollBarPolicy)
      This creates an AbstractScrollPane using the specified resource bundle and using the default of vertical and horizontal scrollbars as required. This is not recommended by default.
  • Method Details

    • getFrame

      public JFrame getFrame()
    • setFrame

      public void setFrame(JFrame frame)
    • initialize

      protected abstract void initialize()
      This initializes the scroll pane, and must be called by inheriting constructors. This MUST end with a call to setPreferences() for this class to work properly.
    • 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 no preferences 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.