public static class UI.PanelFactory
extends java.lang.Object
Factory class for creating panels of components. There are two different types of panels.
1) Component panel. It's essentially a JComponent
that can be decorated with:
ComponentPanelBuilder
2) ProgressBar panel. A panel containing JProgressBar
that has specific layout
which is different from an arbitrary component panel. A progress bar panel can contain following items:
ProgressPanelBuilder
Either of the mentioned panels can be grouped together in a grid. I.e. it's possible to create a grid of
panels see grid()
.
When using grid internal implementation makes sure all labels (if the are placed on the left) are located
in the leftmost column and components/progress bars are in the second column expanding horizontally.
PanelGridBuilder
has convenient PanelGridBuilder.resize()
method that allows rows to expand
vertically when the grid is resized. By default all rows stick to the top of the grid and all available empty space is
expanded below rows.
For concrete examples look ComponentPanelTestAction
test action and class.
Constructor and Description |
---|
PanelFactory() |
Modifier and Type | Method and Description |
---|---|
static PanelGridBuilder |
grid()
Creates a panel grid.
|
static ComponentPanelBuilder |
panel(javax.swing.JComponent component)
Creates a panel builder for arbitrary
JComponent . |
static ProgressPanelBuilder |
panel(javax.swing.JProgressBar progressBar)
Creates a panel builder for arbitrary
JProgressBar . |
public static ComponentPanelBuilder panel(javax.swing.JComponent component)
JComponent
.component
- is the central componentComponentPanelBuilder
for configuring the panel before
creation.public static ProgressPanelBuilder panel(javax.swing.JProgressBar progressBar)
JProgressBar
.progressBar
- is the central progressBarProgressPanelBuilder
for configuring the panel before
creation.public static PanelGridBuilder grid()
PanelGridBuilder