Class DiagramPanel

All Implemented Interfaces:
ActionListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class DiagramPanel extends JPanel implements ActionListener, MouseMotionListener
This java class is used to create and show the 2-D diagrams of the input values
Author:
Sina Tabakhi
See Also:
  • Constructor Details

    • DiagramPanel

      public DiagramPanel(double[][] arrayIteration, int[] arrayCases, String namePanel, String name, String nameY, String nameLegend, String path)
      Creates new form DiagramPanel. This method is called from within the constructor to initialize the form.
      Parameters:
      arrayIteration - the results of all iteration
      arrayCases - the all different cases
      namePanel - the name of main panel
      name - the name of diagram
      nameY - the name of Y-axis
      nameLegend - the name of legend
      path - the path of the workspace
  • Method Details

    • paintComponent

      public void paintComponent(Graphics g)
      This method is used to show the diagram.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - the Graphics context in which to paint
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      The listener method for receiving action events. Invoked when an action occurs.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - an action event
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      The listener method for receiving mouse motion events on a component. Invoked when a mouse button is pressed on a component and then dragged.
      Specified by:
      mouseDragged in interface MouseMotionListener
      Parameters:
      e - an action event
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      The listener method for receiving mouse motion events on a component. Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
      Specified by:
      mouseMoved in interface MouseMotionListener
      Parameters:
      e - an action event