Class JSparklines3dTableCellRenderer

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

public class JSparklines3dTableCellRenderer
extends JLabel
implements TableCellRenderer
Table cell renderer displaying JSparklines 3D plots consisting of multiple values per data series. Supported input: JSparklines3dDataset objects. Other object types are rendered using the DefaultTableCellRenderer.
Author:
Harald Barsnes
See Also:
Serialized Form
  • Constructor Details

    • JSparklines3dTableCellRenderer

      public JSparklines3dTableCellRenderer​(JSparklines3dTableCellRenderer.PlotType plotType, Double minXValue, Double maxXValue, Double minYValue, Double maxYValue)
      Creates a new JSparkLines3dTableCellRenderer.
      Parameters:
      plotType - the plot type
      minXValue - the minimum x value to be plotted, used to make sure that all plots in the same column has the same minimum x value and are thus comparable
      maxXValue - the maximum x value to be plotted, used to make sure that all plots in the same column has the same maximum x value and are thus comparable
      minYValue - the minimum y value to be plotted, used to make sure that all plots in the same column has the same minimum y value and are thus comparable
      maxYValue - the maximum y value to be plotted, used to make sure that all plots in the same column has the same maximum y value and are thus comparable
      Throws:
      IllegalArgumentException - if minXValue > maxXValue or minYValue > maxYValue
  • Method Details

    • getTableCellRendererComponent

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

      public void addXAxisReferenceLine​(String label, double value, float lineWidth, Color lineColor)
      Add a reference line at a given x-axis data value.
      Parameters:
      label - the label for the reference
      value - the reference line value
      lineWidth - the line width, has to non-negative
      lineColor - the line color
    • removeXAxisReferenceLine

      public void removeXAxisReferenceLine​(String label)
      Removes the x-axis reference line with the given label. Does nothing if no reference with the given label is found.
      Parameters:
      label - the reference to remove
    • removeAllXAxisReferenceLines

      public void removeAllXAxisReferenceLines()
      Removes all x-axis reference lines.
    • getAllXAxisReferenceLines

      public HashMap<String,​ReferenceLine> getAllXAxisReferenceLines()
      Returns all the x-axis references lines as a hashmap, with the labels as the keys.
      Returns:
      hashmap of all reference lines
    • addXAxisReferenceArea

      public void addXAxisReferenceArea​(String label, double start, double end, Color areaColor, float alpha)
      Add a x-axis reference area.
      Parameters:
      label - the label for the reference area
      start - the start of the reference area
      end - the end of the reference area
      areaColor - the color of the area
      alpha - the alpha level, range: 0.0 to 1.0
    • removeXAxisReferenceArea

      public void removeXAxisReferenceArea​(String label)
      Removes the x-axis reference area with the given label. Does nothing if no reference with the given label is found.
      Parameters:
      label - the reference to remove
    • removeAllXAxisReferenceAreas

      public void removeAllXAxisReferenceAreas()
      Removes all the x-axis reference areas.
    • getXAxisAllReferenceAreas

      public HashMap<String,​ReferenceArea> getXAxisAllReferenceAreas()
      Returns all the x-axis references areas as a hashmap, with the labels as the keys.
      Returns:
      hashmap of all reference areas
    • addYAxisReferenceLine

      public void addYAxisReferenceLine​(String label, double value, float lineWidth, Color lineColor)
      Add a reference line at a given y-axis data value.
      Parameters:
      label - the label for the reference
      value - the reference line value
      lineWidth - the line width, has to non-negative
      lineColor - the line color
    • removeYAxisReferenceLine

      public void removeYAxisReferenceLine​(String label)
      Removes the y-axis reference line with the given label. Does nothing if no reference with the given label is found.
      Parameters:
      label - the reference to remove
    • removeAllYAxisReferenceLines

      public void removeAllYAxisReferenceLines()
      Removes all y-axis reference lines.
    • getAllYAxisReferenceLines

      public HashMap<String,​ReferenceLine> getAllYAxisReferenceLines()
      Returns all the y-axis references lines as a hashmap, with the labels as the keys.
      Returns:
      hashmap of all reference lines
    • addYAxisReferenceArea

      public void addYAxisReferenceArea​(String label, double start, double end, Color areaColor, float alpha)
      Add a y-axis reference area.
      Parameters:
      label - the label for the reference area
      start - the start of the reference area
      end - the end of the reference area
      areaColor - the color of the area
      alpha - the alpha level, range: 0.0 to 1.0
    • removeYAxisReferenceArea

      public void removeYAxisReferenceArea​(String label)
      Removes the y-axis reference area with the given label. Does nothing if no reference with the given label is found.
      Parameters:
      label - the reference to remove
    • removeAllYAxisReferenceAreas

      public void removeAllYAxisReferenceAreas()
      Removes all the y-axis reference areas.
    • getYAxisAllReferenceAreas

      public HashMap<String,​ReferenceArea> getYAxisAllReferenceAreas()
      Returns all the y-axis references areas as a hashmap, with the labels as the keys.
      Returns:
      hashmap of all reference areas
    • setMaxXValue

      public void setMaxXValue​(double maxXValue)
      Set the maximum x value.
      Parameters:
      maxXValue - the maximum x value
    • setMinXValue

      public void setMinXValue​(double minXValue)
      Set the minimum x value.
      Parameters:
      minXValue - the minimum x value
    • setMaxYValue

      public void setMaxYValue​(double maxYValue)
      Set the maximum y value.
      Parameters:
      maxYValue - the maximum y value
    • setMinYValue

      public void setMinYValue​(double minYValue)
      Set the minimum y value.
      Parameters:
      minYValue - the minimum y value
    • setPlotType

      public void setPlotType​(JSparklines3dTableCellRenderer.PlotType plotType)
      Sets the plot type.
      Parameters:
      plotType - the plotType to set
    • getChartPanel

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