Class PanelBuilder

java.lang.Object
ca.corbett.extras.demo.panels.PanelBuilder
Direct Known Subclasses:
AboutDemoPanel, ActionPanelDemoPanel, AdvancedFormPanel, AnimationPanelEffectsPanel, AnimationScrollDemoPanel, AnimationTextDemoPanel, AudioDemoPanel, BasicFormPanel, CustomFormFieldPanel, DesktopDemoPanel, DirTreeDemoPanel, ExtensionsOverviewPanel, FormActionsPanel, FormHelpPanel, FormsOverviewPanel, FormsRendererPanel, FormsValidationPanel, ImageTextUtilDemoPanel, ImageUtilDemoPanel, IntroPanel, KeyStrokeManagerPanel, ListFieldPanel, LogConsolePanel, ProgressDemoPanel, PropertiesDemoPanel, TextInputDialogPanel

public abstract class PanelBuilder extends Object
Provides an easy abstract way to create new demo panels and load them into the DemoApp.
Since:
2025-03-11
Author:
scorbo2
  • Constructor Details

    • PanelBuilder

      public PanelBuilder()
  • Method Details

    • getTitle

      public abstract String getTitle()
      Returns a name for this PanelBuilder.
      Returns:
      A hopefully descriptive name.
    • build

      public abstract JPanel build()
      Builds and returns the FormPanel (or technically any JPanel) for this builder.
      Returns:
      A populated JPanel (or FormPanel).
    • buildFormPanel

      protected FormPanel buildFormPanel(String title)
      Can be invoked internally to generate the start of a FormPanel suitable for adding example FormFields and controls. This allows the demo panels to have a consistent title header and margin.
    • buildFormPanel

      protected FormPanel buildFormPanel(String title, int margin)
      Can be invoked internally to generate the start of a FormPanel suitable for adding example FormFields and controls. This allows the demo panels to have a consistent title header and margin.
      Parameters:
      title - An optional title for the header label in the form. Can be null for no header label.
      margin - The desired FormPanel margin.
    • buildHighlightedHeaderLabel

      protected LabelField buildHighlightedHeaderLabel(String text, int pointSize)
      Can be invoked internally to create a header label whose color is highlighted according to the current look and feel. A listener will be added such that if the current LaF is changed, this label will recolor itself as needed.
    • createSnippetLabel

      protected LabelField createSnippetLabel(SnippetAction action)
      Shorthand for creating a snippet label with a bottom margin of 16.
    • createSnippetLabel

      protected LabelField createSnippetLabel(SnippetAction action, int bottomMargin)
      Can be invoked by demo panels as a shortcut to create a code snippet label.