Interface TreeAttributes

  • All Known Implementing Classes:
    BasicTreeAttributes

    public interface TreeAttributes
    Attributes to control how a Tree is rendered. The class captures a set of attributes found in a typical tree layout, but some layouts may not use all of these properties.
    See Also:
    TreeLayout
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      TreeAttributes copy()
      Returns a new TreeAttributes instance of the same type as this TreeAttributes, who's properties are configured exactly as this TreeAttributes.
      void copy​(TreeAttributes attributes)
      Copies the specified TreeAttributes' properties into this object's properties.
      java.awt.Color[] getCheckBoxColor()
      Get the color of filled checkboxes that indicate if nodes are selected.
      java.awt.Color getColor()
      Get the color of the text in the tree.
      java.awt.Font getDescriptionFont()
      Get the font used to render the node description.
      java.awt.Font getFont()
      Get the font used to render text.
      java.awt.Dimension getIconSize()
      Get the size of each icon in the tree.
      int getIconSpace()
      Get the amount of space, in pixels, to leave between an icon in the tree and surrounding text and shapes.
      int getRowSpacing()
      Get the space, in pixels, to leave between rows in the tree.
      boolean isRootVisible()
      Should be root node be drawn?
      void setCheckBoxColor​(java.awt.Color color1, java.awt.Color color2)
      Set the color of filled checkboxes that indicate if a node is selected.
      void setColor​(java.awt.Color textColor)
      Set the color of the text in the tree.
      void setDescriptionFont​(java.awt.Font font)
      Set the font used to render the node descriptions.
      void setFont​(java.awt.Font font)
      Set the font used to render text.
      void setIconSize​(java.awt.Dimension size)
      Set the size of each icon in the tree.
      void setIconSpace​(int iconSpace)
      Set the amount of space, in pixels, to leave between an icon in the tree and surrounding text and shapes.
      void setRootVisible​(boolean visible)
      Set the root node to visibile or not visible.
      void setRowSpacing​(int spacing)
      Set the space, in pixels, to leave between rows in the tree.
    • Method Detail

      • copy

        TreeAttributes copy()
        Returns a new TreeAttributes instance of the same type as this TreeAttributes, who's properties are configured exactly as this TreeAttributes.
        Returns:
        a copy of this TreeAttributes.
      • copy

        void copy​(TreeAttributes attributes)
        Copies the specified TreeAttributes' properties into this object's properties. This does nothing if the specified attributes is null.
        Parameters:
        attributes - the attributes to copy.
      • isRootVisible

        boolean isRootVisible()
        Should be root node be drawn?
        Returns:
        True if the root node should be drawn.
        See Also:
        setRootVisible(boolean)
      • setRootVisible

        void setRootVisible​(boolean visible)
        Set the root node to visibile or not visible.
        Parameters:
        visible - True if the root node should be drawn.
        See Also:
        isRootVisible()
      • getColor

        java.awt.Color getColor()
        Get the color of the text in the tree.
        Returns:
        Text color.
        See Also:
        setColor(java.awt.Color)
      • setColor

        void setColor​(java.awt.Color textColor)
        Set the color of the text in the tree.
        Parameters:
        textColor - New text color.
        See Also:
        getColor()
      • getCheckBoxColor

        java.awt.Color[] getCheckBoxColor()
        Get the color of filled checkboxes that indicate if nodes are selected. The checkboxes are drawn as a gradient of two colors.
        Returns:
        two element array of the colors that make up the checkbox gradient.
      • setCheckBoxColor

        void setCheckBoxColor​(java.awt.Color color1,
                              java.awt.Color color2)
        Set the color of filled checkboxes that indicate if a node is selected. The checkboxes are drawn as a gradient of two colors.
        Parameters:
        color1 - first color in the checkbox gradient.
        color2 - second color in the checkbox gradient.
      • getFont

        java.awt.Font getFont()
        Get the font used to render text.
        Returns:
        Tree font.
        See Also:
        setFont(java.awt.Font)
      • getDescriptionFont

        java.awt.Font getDescriptionFont()
        Get the font used to render the node description.
        Returns:
        Font for node description.
      • setDescriptionFont

        void setDescriptionFont​(java.awt.Font font)
        Set the font used to render the node descriptions.
        Parameters:
        font - New font for descriptions.
      • setFont

        void setFont​(java.awt.Font font)
        Set the font used to render text.
        Parameters:
        font - New tree font.
        See Also:
        getFont()
      • getRowSpacing

        int getRowSpacing()
        Get the space, in pixels, to leave between rows in the tree.
        Returns:
        Space in pixels between rows.
        See Also:
        setRowSpacing(int)
      • setRowSpacing

        void setRowSpacing​(int spacing)
        Set the space, in pixels, to leave between rows in the tree.
        Parameters:
        spacing - Row spacing.
        See Also:
        getRowSpacing()
      • getIconSize

        java.awt.Dimension getIconSize()
        Get the size of each icon in the tree. If the icon images do not match this size, they will be scaled to fit.
        Returns:
        Icon size.
        See Also:
        setIconSize(java.awt.Dimension)
      • setIconSize

        void setIconSize​(java.awt.Dimension size)
        Set the size of each icon in the tree.
        Parameters:
        size - New size.
        See Also:
        getIconSize()
      • getIconSpace

        int getIconSpace()
        Get the amount of space, in pixels, to leave between an icon in the tree and surrounding text and shapes.
        Returns:
        Icon space in pixels.
        See Also:
        setIconSpace(int)
      • setIconSpace

        void setIconSpace​(int iconSpace)
        Set the amount of space, in pixels, to leave between an icon in the tree and surrounding text and shapes.
        Parameters:
        iconSpace - Icon space in pixels.
        See Also:
        getIconSpace()