Class LevelRenderer

All Implemented Interfaces:
Serializable, Cloneable, CategoryItemRenderer, org.jfree.util.PublicCloneable

public class LevelRenderer
extends AbstractCategoryItemRenderer
implements Cloneable, org.jfree.util.PublicCloneable, Serializable
A CategoryItemRenderer that draws individual data items as horizontal lines, spaced in the same way as bars in a bar chart.
See Also:
Serialized Form
  • Field Details

    • DEFAULT_ITEM_MARGIN

      public static final double DEFAULT_ITEM_MARGIN
      The default item margin percentage.
      See Also:
      Constant Field Values
  • Constructor Details

    • LevelRenderer

      public LevelRenderer()
      Creates a new renderer with default settings.
  • Method Details

    • getItemMargin

      public double getItemMargin()
      Returns the item margin.
      Returns:
      The margin.
    • setItemMargin

      public void setItemMargin​(double percent)
      Sets the item margin. The value is expressed as a percentage of the available width for plotting all the bars, with the resulting amount to be distributed between all the bars evenly.
      Parameters:
      percent - the new margin.
    • getMaxItemWidth

      public double getMaxItemWidth()
      Returns the maximum width, as a percentage of the available drawing space.
      Returns:
      the maximum width.
    • setMaxItemWidth

      public void setMaxItemWidth​(double percent)
      Sets the maximum item width, which is specified as a percentage of the available space for all items, and sends a RendererChangeEvent to all registered listeners.
      Parameters:
      percent - the percent.
    • initialise

      public CategoryItemRendererState initialise​(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)
      Initialises the renderer and returns a state object that will be passed to subsequent calls to the drawItem method.

      This method gets called once at the start of the process of drawing a chart.

      Specified by:
      initialise in interface CategoryItemRenderer
      Overrides:
      initialise in class AbstractCategoryItemRenderer
      Parameters:
      g2 - the graphics device.
      dataArea - the area in which the data is to be plotted.
      plot - the plot.
      rendererIndex - the renderer index.
      info - collects chart rendering information for return to caller.
      Returns:
      The renderer state.
    • drawItem

      public void drawItem​(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column)
      Draws the bar for a single (series, category) data item.
      Specified by:
      drawItem in interface CategoryItemRenderer
      Parameters:
      g2 - the graphics device.
      state - the renderer state.
      dataArea - the data area.
      plot - the plot.
      domainAxis - the domain axis.
      rangeAxis - the range axis.
      dataset - the dataset.
      row - the row index (zero-based).
      column - the column index (zero-based).
    • equals

      public boolean equals​(Object object)
      Tests an object for equality with this instance.
      Overrides:
      equals in class AbstractCategoryItemRenderer
      Parameters:
      object - the object.
      Returns:
      A boolean.