java.lang.Object
com.marginallyclever.ro3.PanelHelper

public class PanelHelper extends Object
PanelHelper is a collection of static methods to help build panels.
  • Constructor Details

    • PanelHelper

      public PanelHelper()
  • Method Details

    • addLabelAndComponent

      public static void addLabelAndComponent(JPanel pane, String labelText, JComponent component)

      A convenience method to add a label and component to a panel that is built with GridLayout.

      Parameters:
      pane - the panel to add to
      labelText - the text for the label
      component - 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 to
      labelText - the text for the label
      component - the component to add
      gbc - 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 the NodeSelector.
      Parameters:
      pane - the panel to add to
      label - the text for the label
      nodePath - the NodePath to use
      gbc - the GridBagConstraints to use
      clazz - the class of the Node
      origin - the origin Node for the relative path.
      Returns:
      the NodeSelector