Class BandwidthMonitor

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public final class BandwidthMonitor extends LineGraph
This class displays the current bandwidth travelling through a particular portConnector.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • BandwidthMonitor

      public BandwidthMonitor(PortConnector port)
      Create a BandwidthMonitor widget for the specified port.
      Parameters:
      port - PortConnector to monitor
    • BandwidthMonitor

      public BandwidthMonitor(PortConnector port, PortConnector.PortStatsType portStatsType)
      Create a BandwidthMonitor widget for the specified port.
      Parameters:
      port - PortConnector to monitor
      portStatsType - which type of statistics to report
  • Method Details

    • getFooter

      protected 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.
      Specified by:
      getFooter in class LineGraph
      Returns:
      footer String
    • getTitle

      protected String getTitle()
      Get the title string for this widget.
      Specified by:
      getTitle in class LineGraph
      Returns:
      title String
    • getStatsLength

      protected int getStatsLength()
      Report the number of statistics data points available.
      Specified by:
      getStatsLength in class LineGraph
      Returns:
      positive count of data point
    • getStatsValue

      protected float getStatsValue(int index)
      Data value at the specified zero-based index into the data.
      Specified by:
      getStatsValue in class LineGraph
      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)
    • showBMDialog

      public static JDialog showBMDialog(Window window, Collection<PortConnector> ports)
      Display the modeless dialog containing the bandwidth monitors, showing network bandwidth consumed by each interface port.
      Parameters:
      window - Window that will be parent to the displayed dialog
      ports - the array of PortConnectors for ports whose bandwidth utilization is to be monitored
      Returns:
      JDialog containing an array of BandwidthMonitor widgets corresponding to the passed-in PortConnectors