Class NodePanel


  • public final class NodePanel
    extends NodeElement
    Defines an element that holds other elements. Panels determine the sizing and positioning of their elements. The panel elements are drawn in the order in which they appear in the elements collection.
    Since:
    1.2.0
    • Constructor Detail

      • NodePanel

        public NodePanel()
        Constructs a new NodePanel. The default layout is HORIZONTAL and default alignment is CENTER.
    • Method Detail

      • addElement

        public void addElement​(NodeElement elements)
        Adds an element to this panel's element list.
        Parameters:
        elements - collection of elements.
      • getElements

        public java.util.List<NodeElement> getElements()
        Returns the collection of the elements managed by this panel.
      • getPanelLayout

        public PanelLayout getPanelLayout()
        Returns the panel layout which controls how the panel's elements are measured and arranged.
      • setPanelLayout

        public void setPanelLayout​(PanelLayout panelLayout)
        Sets the panel layout which controls how the panel's elements are measured and arranged.
        Parameters:
        panelLayout - the panel layout.
      • getContentAlignment

        public AlignmentType getContentAlignment()
        Sets the content alignment of this panel. This is used as the alignment for elements contained in this panel.
      • setContentAlignment

        public void setContentAlignment​(AlignmentType contentAlignment)
        Returns the default alignment of this panel. This is used as the alignment for elements contained in this panel.
        Parameters:
        contentAlignment - the content alignment of this Panel.
      • getBorderColor

        public java.lang.String getBorderColor()
        Returns the panel border color in hex.
      • setBorderColor

        public void setBorderColor​(java.lang.String borderColor)
        Sets the panel border color.
        Parameters:
        borderColor - a color in hex
      • getBorderWidth

        public int getBorderWidth()
        Returns the panel border width.
      • setBorderWidth

        public void setBorderWidth​(int borderWidth)
        Sets the panel border width.
        Parameters:
        borderWidth - a number from 1 to 4.
      • getBorderStyle

        public BorderStyle getBorderStyle()
        Returns the panel border style.
      • setBorderStyle

        public void setBorderStyle​(BorderStyle borderStyle)
        Sets the panel border style.
        Parameters:
        borderStyle - the border style of this panel .