Class Renderer

    • Field Detail

      • BACKGROUND_EDITING_DEBUG

        public static final Color BACKGROUND_EDITING_DEBUG
        the color for debugging background (editing).
      • BACKGROUND_RUNNING_DEBUG

        public static final Color BACKGROUND_RUNNING_DEBUG
        the color for debugging background (running).
      • BACKGROUND_RUNNING

        public static final Color BACKGROUND_RUNNING
        the color for background (running).
      • COLOR_DEPRECATED

        public static final Color COLOR_DEPRECATED
        the color for deprecated actors.
      • COLOR_VISUALCUES

        public static final Color COLOR_VISUALCUES
        the color for visual cues.
      • BORDER_MARGIN

        public static final int BORDER_MARGIN
        the border margin.
        See Also:
        Constant Field Values
      • m_ScaleFactor

        protected double m_ScaleFactor
        the scaling factor for the icons.
    • Constructor Detail

      • Renderer

        public Renderer()
        Initializes the renderer with scale factor of "1.0".
      • Renderer

        public Renderer​(double scaleFactor)
        Initializes the renderer.
        Parameters:
        scaleFactor - the scale factor for text/icon
    • Method Detail

      • getScaleFactor

        public double getScaleFactor()
        Returns the current scale factor for text/icon.
        Returns:
        the scale factor
      • getIcon

        protected Renderer.ActorIcon getIcon​(Actor parent,
                                             Actor actor,
                                             boolean collapsed)
        Tries to obtain the icon for the given actor.
        Parameters:
        parent - the parent actor, null if root
        actor - the actor get the icon for
        collapsed - whether the node is collapsed
        Returns:
        the associated icon or null if not found
      • getTreeCellRendererComponent

        public Component getTreeCellRendererComponent​(JTree tree,
                                                      Object value,
                                                      boolean sel,
                                                      boolean expanded,
                                                      boolean leaf,
                                                      int row,
                                                      boolean hasFocus)
        For rendering the cell.
        Specified by:
        getTreeCellRendererComponent in interface TreeCellRenderer
        Overrides:
        getTreeCellRendererComponent in class DefaultTreeCellRenderer
        Parameters:
        tree - the tree
        value - the node
        sel - whether the element is selected
        expanded - whether the node is expanded
        leaf - whether the node is a leaf
        row - the row in the tree
        hasFocus - whether the node is focused
        Returns:
        the rendering component