Class BaseTab

java.lang.Object
net.minheur.potoflux.screen.tabs.BaseTab
Direct Known Subclasses:
AccountTab, HomeTab, SettingsTab, TerminalTab

public abstract class BaseTab extends Object
The base tab, overridden to create your own tabs.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final JPanel
    The actual JPanel, that will be added to the tabbed pane.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the tab.
    It will do the preset if enabled, and execute (or invokeLater) the setPanel() method, to add data to the PANEL.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Creates the title, from the text given via getTitle().
    It is used in the preset()
    protected boolean
    Handles if the preset should be executed.
    True by default.
    Getter for the PANEL.
    protected String
    Used to set the title.
    protected boolean
    Deprecated.
    protected void
    The preset, that is by default enabled.
    It sets the layout and add the title.
    protected abstract void
    This is the actual method to set the panel.
    The overriding class will have to use this to add content to the PANEL.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PANEL

      protected final JPanel PANEL
      The actual JPanel, that will be added to the tabbed pane.
  • Constructor Details

    • BaseTab

      public BaseTab()
      Constructor for the tab.
      It will do the preset if enabled, and execute (or invokeLater) the setPanel() method, to add data to the PANEL.
  • Method Details

    • preset

      protected void preset()
      The preset, that is by default enabled.
      It sets the layout and add the title.
    • setPanel

      protected abstract void setPanel()
      This is the actual method to set the panel.
      The overriding class will have to use this to add content to the PANEL.
    • getTitle

      protected String getTitle()
      Used to set the title.
      Returns:
      the title of the tab.
    • getPanel

      public JPanel getPanel()
      Getter for the PANEL.
      Returns:
      the PANEL
    • doPreset

      protected boolean doPreset()
      Handles if the preset should be executed.
      True by default.
      Returns:
      if the preset should be executed
    • invokeLater

      @Deprecated(since="6.4") protected boolean invokeLater()
      Deprecated.
      Handles if the creation should be added to the swing EDT, otherwise it will be executed on the tab creation.
      Returns:
      if the app should be SwingUtilities.invokeLater(Runnable).
    • createTitle

      protected void createTitle()
      Creates the title, from the text given via getTitle().
      It is used in the preset()