java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
cz.fidentis.analyst.gui.elements.histogram.components.chart.Chart
All Implemented Interfaces:
EventGenerator, ImageObserver, MenuContainer, Serializable, Accessible

public class Chart extends JPanel implements EventGenerator

Class for representing a chart.

Dispatches ActionEvent with the following action commands:

See Also:
  • Field Details

  • Constructor Details

    • Chart

      public Chart()
      Creates a new instance.
  • Method Details

    • getHorizontalScale

      public FunctionScale getHorizontalScale()
    • getChartBodyWidth

      public int getChartBodyWidth()
    • setVerticalScale

      public void setVerticalScale(FunctionScale yScale)
      Set vertical scale. Automatically updates the ChartBody and labels on VerticalAxis.
      Parameters:
      yScale - y-axis scale
    • setPaints

      public void setPaints(Paint stroke, Paint fill)
      Set paints that the chart will use. The change is immediate - call to updateChart() is unnecessary.
      See Also:
    • updateChart

      public void updateChart()
      Update chart. That means repainting ChartBody and updating labels on HorizontalAxis.
    • resetChart

      public void resetChart()
      Reset chart. That includes resetting zoom on x-axis, updating ChartBody and labels on HorizontalAxis.
    • setValues

      public void setValues(List<Integer> values, double minLabel, double maxLabel)
      Set chart values.
      Parameters:
      values - list of values
      minLabel - minimum label value (x-axis)
      maxLabel - maximum label value (x-axis)
    • addActionListener

      public boolean addActionListener(ActionListener listener)
      Specified by:
      addActionListener in interface EventGenerator
      Parameters:
      listener - listener
      Returns:
      true if listener was successfully added to the collection
    • removeActionListener

      public boolean removeActionListener(ActionListener listener)
      Specified by:
      removeActionListener in interface EventGenerator
      Parameters:
      listener - listener
      Returns:
      true if listener was successfully removed from the collection