Class ScalingLabelRenderer<N>

java.lang.Object
de.engehausen.treemap.swing.impl.ScalingLabelRenderer<N>
Type Parameters:
N - the type of node the rectangles work on.
All Implemented Interfaces:
IRectangleRenderer<N,Graphics2D,Color>

public class ScalingLabelRenderer<N> extends Object implements IRectangleRenderer<N,Graphics2D,Color>
Renders labels for rectangles scaled to fit the rectangles, keeping proportion of the font used.
  • Field Details

    • normal

      protected final Color normal
    • highlight

      protected final Color highlight
    • font

      protected final Font font
    • showRoot

      protected final boolean showRoot
  • Constructor Details

    • ScalingLabelRenderer

      public ScalingLabelRenderer(Font aFont, Color aNormalColor, Color aHighlightColor)
      Create the renderer using the given font and label colors. The root node is not labeled.
      Parameters:
      aFont - the font, must not be null.
      aNormalColor - the color for painting the label when not selected, must not be null.
      aHighlightColor - the color for painting the label when selected, must not be null.
    • ScalingLabelRenderer

      public ScalingLabelRenderer(Font aFont, Color aNormalColor, Color aHighlightColor, boolean showsRoot)
      Create the renderer using the given font and label colors.
      Parameters:
      aFont - the font, must not be null.
      aNormalColor - the color for painting the label when not selected, must not be null.
      aHighlightColor - the color for painting the label when selected, must not be null.
      showsRoot - true if the root node label should be shown, false otherwise.
  • Method Details