com.jinsight.jetchart
Class ScatterGraphEventListener

java.lang.Object
  |
  +--com.jinsight.jetchart.ScatterGraphEventListener
All Implemented Interfaces:
java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class ScatterGraphEventListener
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

This class implements callback methods to handle mouse events dispatched by the ScatterGraph class. If for some reason mouse event handling has to be changed without losing pre-built functionalities, remove references to an instance of this class from the ScatterGraph object and extend ScatterGraphEventListener, changing the callback methods adequately. To remove the primary ScatterGraphEventListener, which is created when the ScatterGraph class is instantiated, do as follows:

ScatterGraph graph=new ScatterGraph();
ScatterGraphEventListener sg=graph.getScatterGraphEventListener();
graph.removeMouseListener(sg);
graph.removeMouseMotionListener(sg);

See Also:
ScatterGraph, ScatterGraph.getScatterGraphEventListener()

Constructor Summary
ScatterGraphEventListener(ScatterGraph scatterGraph)
          Constructor of the ScatterGraphEventListener class.
 
Method Summary
protected  void finalize()
           
 void mouseClicked(java.awt.event.MouseEvent evt)
          This method is called when a mouse button is pressed and released within the chart area.
 void mouseDragged(java.awt.event.MouseEvent evt)
          This method is called when mouse cursor is clicked within the chart area and dragged.
 void mouseEntered(java.awt.event.MouseEvent evt)
          This method is called when the cursor enters the chart area.
 void mouseExited(java.awt.event.MouseEvent evt)
          This method is called when the cursor exits the chart area.
 void mouseMoved(java.awt.event.MouseEvent evt)
          This method is called when mouse cursor is moved within the chart area.
 void mousePressed(java.awt.event.MouseEvent evt)
          This method is called when a mouse button is pressed within the chart area.
 void mouseReleased(java.awt.event.MouseEvent evt)
          This method is called when a mouse button is released within the chart area.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScatterGraphEventListener

public ScatterGraphEventListener(ScatterGraph scatterGraph)
Constructor of the ScatterGraphEventListener class. It takes a reference to the ScatterGraph object which triggers the mouse events to be dealt with.
Parameters:
graph - A ScatterGraph object.
See Also:
ScatterGraph
Method Detail

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
This method is called when a mouse button is pressed within the chart area.
Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
evt - A MouseEvent object.

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
This method is called when a mouse button is released within the chart area.
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
evt - A MouseEvent object.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent evt)
This method is called when a mouse button is pressed and released within the chart area.
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
evt - A MouseEvent object.

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
This method is called when the cursor exits the chart area.
Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
evt - A MouseEvent object.

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
This method is called when the cursor enters the chart area.
Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
evt - A MouseEvent object.

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent evt)
This method is called when mouse cursor is moved within the chart area.
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
evt - A MouseEvent object.

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
This method is called when mouse cursor is clicked within the chart area and dragged.
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
evt - A MouseEvent object.

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object