Class JSparklinesHeatMapTableCellRenderer

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
no.uib.jsparklines.renderers.JSparklinesHeatMapTableCellRenderer
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, TableCellRenderer

public class JSparklinesHeatMapTableCellRenderer
extends JLabel
implements TableCellRenderer
Table cell renderer displaying JSparklinesDataSeries as heat maps where the double values are used the color coding. Supported input: JSparklinesDataSeries objects. Other object types are rendered using the DefaultTableCellRenderer.
Author:
Harald Barsnes
See Also:
Serialized Form
  • Constructor Details

    • JSparklinesHeatMapTableCellRenderer

      public JSparklinesHeatMapTableCellRenderer​(GradientColorCoding.ColorGradient currentColorGradient, double maxValue)
      Creates a new JSparkLinesTableCellRenderer. Use this constructor when creating pie charts where no upper range is used.
      Parameters:
      currentColorGradient - the color gradient
      maxValue - the maximum heat map value
  • Method Details

    • setMaxValue

      public void setMaxValue​(double maxValue)
      Set the maximum value.
      Parameters:
      maxValue - the maximum value
    • getChartPanel

      public org.jfree.chart.ChartPanel getChartPanel()
      Returns a reference to the chart panel.
      Returns:
      the chart panel.
    • setBackgroundColor

      public void setBackgroundColor​(Color color)
      Set the background color. If not set the background color of the given row will be used.
      Parameters:
      color - the new background color
    • setGradientColoring

      public void setGradientColoring​(GradientColorCoding.ColorGradient colorGradient, boolean positiveColorGradient, Color plotBackgroundColor)
      Set the color gradient to use for the bars.

      The first color of the gradient is used for values close to the min value, while the third color of the gradient is used for values close to the max value. If only positive values are expected (positiveColorGradient is true) the middle gradient color is used for the halfway point between the min and max values. If both positive and negative values are expected (positiveColorGradient is false) the middle gradient color is used for values around zero.
      Parameters:
      colorGradient - the color gradient to use, null disables the color gradient
      positiveColorGradient - if true only positive values are expected and the middle gradient color is used for the halfway point between the min and max values, if false the middle gradient color is used for values around zero
      plotBackgroundColor - the background color to use, for gradients using white as the "middle" color, it's recommended to use a dark background color
    • getTableCellRendererComponent

      public Component getTableCellRendererComponent​(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
      Specified by:
      getTableCellRendererComponent in interface TableCellRenderer