Class MinMaxCategoryRenderer

All Implemented Interfaces:
Serializable, Cloneable, LegendItemSource, CategoryItemRenderer, PublicCloneable

public class MinMaxCategoryRenderer extends AbstractCategoryItemRenderer
Renderer for drawing min max plot. This renderer draws all the series under the same category in the same x position using objectIcon and a line from the maximum value to the minimum value. For use with the CategoryPlot class. The example shown here is generated by the MinMaxCategoryPlotDemo1.java program included in the JFreeChart Demo Collection:

MinMaxCategoryRendererSample.png
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For serialization.
      See Also:
    • plotLines

      private boolean plotLines
      A flag indicating whether or not lines are drawn between XY points.
    • groupPaint

      private transient Paint groupPaint
      The paint of the line between the minimum value and the maximum value.
    • groupStroke

      private transient Stroke groupStroke
      The stroke of the line between the minimum value and the maximum value.
    • minIcon

      private transient Icon minIcon
      The icon used to indicate the minimum value.
    • maxIcon

      private transient Icon maxIcon
      The icon used to indicate the maximum value.
    • objectIcon

      private transient Icon objectIcon
      The icon used to indicate the values.
    • lastCategory

      private int lastCategory
      The last category.
    • min

      private double min
      The minimum.
    • max

      private double max
      The maximum.
  • Constructor Details

    • MinMaxCategoryRenderer

      public MinMaxCategoryRenderer()
      Default constructor.
  • Method Details

    • isDrawLines

      public boolean isDrawLines()
      Gets whether or not lines are drawn between category points.
      Returns:
      boolean true if line will be drawn between sequenced categories, otherwise false.
      See Also:
    • setDrawLines

      public void setDrawLines(boolean draw)
      Sets the flag that controls whether or not lines are drawn to connect the items within a series and sends a RendererChangeEvent to all registered listeners.
      Parameters:
      draw - the new value of the flag.
      See Also:
    • getGroupPaint

      public Paint getGroupPaint()
      Returns the paint used to draw the line between the minimum and maximum value items in each category.
      Returns:
      The paint (never null).
      See Also:
    • setGroupPaint

      public void setGroupPaint(Paint paint)
      Sets the paint used to draw the line between the minimum and maximum value items in each category and sends a RendererChangeEvent to all registered listeners.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getGroupStroke

      public Stroke getGroupStroke()
      Returns the stroke used to draw the line between the minimum and maximum value items in each category.
      Returns:
      The stroke (never null).
      See Also:
    • setGroupStroke

      public void setGroupStroke(Stroke stroke)
      Sets the stroke of the line between the minimum value and the maximum value and sends a RendererChangeEvent to all registered listeners.
      Parameters:
      stroke - the new stroke (null not permitted).
    • getObjectIcon

      public Icon getObjectIcon()
      Returns the icon drawn for each data item.
      Returns:
      The icon (never null).
      See Also:
    • setObjectIcon

      public void setObjectIcon(Icon icon)
      Sets the icon drawn for each data item and sends a RendererChangeEvent to all registered listeners.
      Parameters:
      icon - the icon.
      See Also:
    • getMaxIcon

      public Icon getMaxIcon()
      Returns the icon displayed for the maximum value data item within each category.
      Returns:
      The icon (never null).
      See Also:
    • setMaxIcon

      public void setMaxIcon(Icon icon)
      Sets the icon displayed for the maximum value data item within each category and sends a RendererChangeEvent to all registered listeners.
      Parameters:
      icon - the icon (null not permitted).
      See Also:
    • getMinIcon

      public Icon getMinIcon()
      Returns the icon displayed for the minimum value data item within each category.
      Returns:
      The icon (never null).
      See Also:
    • setMinIcon

      public void setMinIcon(Icon icon)
      Sets the icon displayed for the minimum value data item within each category and sends a RendererChangeEvent to all registered listeners.
      Parameters:
      icon - the icon (null not permitted).
      See Also:
    • drawItem

      public void drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass)
      Draw a single data item.
      Parameters:
      g2 - the graphics device.
      state - the renderer state.
      dataArea - the area in which the data is drawn.
      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).
      pass - the pass index.
    • equals

      public boolean equals(Object obj)
      Tests this instance for equality with an arbitrary object. The icon fields are NOT included in the test, so this implementation is a little weak.
      Overrides:
      equals in class AbstractCategoryItemRenderer
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.
    • getIcon

      private Icon getIcon(Shape shape, Paint fillPaint, Paint outlinePaint)
      Returns an icon.
      Parameters:
      shape - the shape.
      fillPaint - the fill paint.
      outlinePaint - the outline paint.
      Returns:
      The icon.
    • getIcon

      private Icon getIcon(Shape shape, boolean fill, boolean outline)
      Returns an icon from a shape.
      Parameters:
      shape - the shape.
      fill - the fill flag.
      outline - the outline flag.
      Returns:
      The icon.
    • writeObject

      private void writeObject(ObjectOutputStream stream) throws IOException
      Provides serialization support.
      Parameters:
      stream - the output stream.
      Throws:
      IOException - if there is an I/O error.
    • readObject

      private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
      Provides serialization support.
      Parameters:
      stream - the input stream.
      Throws:
      IOException - if there is an I/O error.
      ClassNotFoundException - if there is a classpath problem.