Class FastGraph

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class FastGraph extends JPanel

Title: FastGraph

Description: Displays a graph with autoresizing property. This is designed to be a really lightweight component as is supposed to be updated during simulation. The component will draw data from a vector that can be changed to update the graph. List must contain only object implementing MeasureDefinition.Value interface. After updating List, user should call repaint() method to force update of this graph. Labels on x axis are based on xunit value specified in the constructor or on SimulationTime.

Author:
Bertoli Marco Date: 27-set-2005 Time: 12.34.37
See Also:
  • Field Details

  • Constructor Details

    • FastGraph

      public FastGraph(List<MeasureValue> values, double xunit)
      Builds a new FastGraph with specified input vector.
      Parameters:
      values - vector with values to be shown on graph (in MeasureValue format)
      xunit - measure of unit of x axis. Each sample is distant from previous one of xunit.
  • Method Details

    • paint

      public void paint(Graphics g)
      Overrides default paint method to draw the graph
      Overrides:
      paint in class JComponent
      Parameters:
      g - graphic component
    • setHideLastInterval

      public void setHideLastInterval(boolean flag)
      Show/hide last interval display
      Parameters:
      flag - true to show last interval lines, false to hide them
    • mouseClicked

      public void mouseClicked(MouseEvent ev)
      Invoked when mouse is clicked on the graph
      Parameters:
      ev - the click event