java.lang.Object
org.rrd4j.graph.LegendComposer
All Implemented Interfaces:
RrdGraphConstants

class LegendComposerextends Object implements RrdGraphConstants
Handles legend composition and layout for RRD graphs. Manages text positioning, alignment, and spacing within the legend area.
  • Field Details

    • gdef

      private final RrdGraphDef gdef
      The graph definition being composed.
    • worker

      private final ImageWorker worker
      Where the legend is drawn.
    • legX

      private final int legX
      X-coordinate for legend placement
    • legY

      private int legY
      Y-coordinate for legend placement
    • legWidth

      private final int legWidth
      Available width for legend content
    • interLegendSpace

      private final double interLegendSpace
      Spacing between legend elements
    • leading

      private final double leading
      Line height for legend text
    • smallLeading

      private final double smallLeading
      Line height for small legend text
    • boxSpace

      private final double boxSpace
      Space around legend boxes
  • Constructor Details

    • LegendComposer

      LegendComposer(RrdGraphGenerator generator, int legX, int legY, int legWidth)
      Creates a legend composer with specified positioning and dimensions.
      Parameters:
      generator - graph generator for font and spacing calculations
      legX - x-coordinate for legend placement
      legY - y-coordinate for legend placement
      legWidth - available width for legend content
  • Method Details

    • placeComments

      int placeComments()
      Lays out every valid graph comment as one or more legend lines
      Returns:
      the legend y offset, left just below the block that was placed