java.lang.Object
com.marginallyclever.ro3.PanelHelper
PanelHelper
is a collection of static methods to help build panels.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addLabelAndComponent
(JPanel pane, String labelText, JComponent component) A convenience method to add a label and component to a panel that is built withGridLayout
.static void
addLabelAndComponent
(JPanel pane, String labelText, JComponent component, GridBagConstraints gbc) A convenience method to add a label and component to a panel that is built withGridBagLayout
.static <T extends Node>
NodeSelector<T> addNodeSelector
(JPanel pane, String label, NodePath<T> nodePath, GridBagConstraints gbc) A convenience method to add a label and component to a panel that is expected to be built with GridBagConstraint.
-
Constructor Details
-
PanelHelper
public PanelHelper()
-
-
Method Details
-
addLabelAndComponent
A convenience method to add a label and component to a panel that is built with
GridLayout
.- Parameters:
pane
- the panel to add tolabelText
- the text for the labelcomponent
- the component to add
-
addLabelAndComponent
public static void addLabelAndComponent(JPanel pane, String labelText, JComponent component, GridBagConstraints gbc) A convenience method to add a label and component to a panel that is built with
GridBagLayout
.- Parameters:
pane
- the panel to add tolabelText
- the text for the labelcomponent
- the component to addgbc
- the GridBagConstraints to use
-
addNodeSelector
public static <T extends Node> NodeSelector<T> addNodeSelector(JPanel pane, String label, NodePath<T> nodePath, GridBagConstraints gbc) A convenience method to add a label and component to a panel that is expected to be built with GridBagConstraint.- Type Parameters:
T
- the type filter for theNodeSelector
.- Parameters:
pane
- the panel to add tolabel
- the text for the labelnodePath
- the NodePath to usegbc
- theGridBagConstraints
to useclazz
- the class of the Nodeorigin
- the origin Node for the relative path.- Returns:
- the NodeSelector
-