Class LineGraph

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
BandwidthMonitor

public abstract class LineGraph extends JComponent
This class displays a generic line graph..
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • LineGraph

      protected LineGraph()
      Create a LineGraph widget.
  • Method Details

    • init

      protected void init()
      Do any initialization that requires subclass constructor execution first (not just the super() call to this class's constructor).
    • getTitle

      protected abstract String getTitle()
      Get the title string for this widget.
      Returns:
      title String
    • startPlotting

      protected void startPlotting()
      Called before actual data points are plotted. Expected to be overridden by subclasses.
    • getFooter

      protected abstract String getFooter()
      Get the text to be displayed at the bottom of the widget. Called after all data points that will fit on the widget are plotted.
      Returns:
      footer String
    • getStatsLength

      protected abstract int getStatsLength()
      Report the number of statistics data points available.
      Returns:
      positive count of data point
    • getStatsValue

      protected abstract float getStatsValue(int index)
      Data value at the specified zero-based index into the data.
      Parameters:
      index - int index in the range 0 to getStatsLength()-1
      Returns:
      data value in the range 0.0F to 1.0F (will be scaled to fit height of widget)
    • paintComponent

      protected void paintComponent(Graphics g)
      Paint the recent bandwidth utilization history on the widget.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - Graphics object to use for drawing