Package ca.corbett.extras.demo.panels
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
Provides an easy abstract way to create new demo panels and load them into the DemoApp.
- Since:
- 2025-03-11
- Author:
- scorbo2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract JPanelbuild()Builds and returns the FormPanel (or technically any JPanel) for this builder.protected FormPanelbuildFormPanel(String title) Can be invoked internally to generate the start of a FormPanel suitable for adding example FormFields and controls.protected FormPanelbuildFormPanel(String title, int margin) Can be invoked internally to generate the start of a FormPanel suitable for adding example FormFields and controls.protected LabelFieldbuildHighlightedHeaderLabel(String text, int pointSize) Can be invoked internally to create a header label whose color is highlighted according to the current look and feel.protected LabelFieldcreateSnippetLabel(SnippetAction action) Shorthand for creating a snippet label with a bottom margin of 16.protected LabelFieldcreateSnippetLabel(SnippetAction action, int bottomMargin) Can be invoked by demo panels as a shortcut to create a code snippet label.abstract StringgetTitle()Returns a name for this PanelBuilder.
-
Constructor Details
-
PanelBuilder
public PanelBuilder()
-
-
Method Details
-
getTitle
Returns a name for this PanelBuilder.- Returns:
- A hopefully descriptive name.
-
build
Builds and returns the FormPanel (or technically any JPanel) for this builder.- Returns:
- A populated JPanel (or FormPanel).
-
buildFormPanel
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
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
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
Shorthand for creating a snippet label with a bottom margin of 16. -
createSnippetLabel
Can be invoked by demo panels as a shortcut to create a code snippet label.
-