com.jinsight.jetchart
Class SerieEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.jinsight.jetchart.SerieEvent
All Implemented Interfaces:
java.io.Serializable

public class SerieEvent
extends java.util.EventObject

Series events are generated by a chart context when the user interacts with the series data points and legend box symbols using mouse. If mouse is hovered over a series data point, like a x,y coordinate, a bar in a bar series, or a slice in a pie series, or a series data point is clicked or dragged, a SerieEvent object is delivered to series events listeners. A series event is also dispatched if a legend symbol is clicked.

See Also:
SerieListener, GenericGraph.addSerieListener(com.jinsight.jetchart.SerieListener), Graph.setSerieDraggingEnabled(boolean), Serialized Form

Fields inherited from class java.util.EventObject
source
 
Constructor Summary
SerieEvent(GenericGraph genericGraph, AbstractSerie as, int elementIndex, boolean isOverLegend, int x, int y, int clickCount)
          Constructor of the SerieEvent class.
 
Method Summary
protected  void finalize()
           
 int getClickCount()
          Returns the number of quick, consecutive clicks on a series data point.
 int getElementIndex()
          Returns the index of a series data point or a legend symbol.
 GenericGraph getGraph()
          Returns a reference to the GenericGraph object that fired the series event.
 AbstractSerie getSerie()
          Returns a reference to the series object that was clicked or dragged.
 int getX()
          Returns the x coordinate of the mouse cursor when a series is clicked or dragged.
 int getY()
          Returns the y coordinate of the mouse cursor when a series is clicked or dragged.
 boolean isOverLegend()
          Indicates whether a legend symbol was clicked or not.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SerieEvent

public SerieEvent(GenericGraph genericGraph,
                  AbstractSerie as,
                  int elementIndex,
                  boolean isOverLegend,
                  int x,
                  int y,
                  int clickCount)
Constructor of the SerieEvent class. If a series data point is clicked, released, dragged or mouse cursor is moved over it, a SerieEvent object is created and dispatched to series listeners added to the chart context.
Parameters:
genericGraph - A GenericGraph object. The component that fired the series event.
as - An AbstractSerie object. The series the mouse interacts with.
elementIndex - The index of a series data point or a legend symbol in the legend box.
isOverLegend - A boolean value. True if a legend symbol was clicked.
x - The mouse cursor x coordinate.
y - The mouse cursor y coordinate.
clickCount - The number of quick, consecutive clicks of a mouse button.
See Also:
SerieListener, GenericGraph.addSerieListener(com.jinsight.jetchart.SerieListener), Graph.setSerieDraggingEnabled(boolean)
Method Detail

getGraph

public GenericGraph getGraph()
Returns a reference to the GenericGraph object that fired the series event.
Returns:
A GenericGraph object.

getSerie

public AbstractSerie getSerie()
Returns a reference to the series object that was clicked or dragged.
Returns:
An AbstractSerie object.

getElementIndex

public int getElementIndex()
Returns the index of a series data point or a legend symbol. If mouse cursor is positioned within a series data point bounds, the index is set to a value different of -1. The index is usually checked in a series event handler to get the value that corresponds to a series data point or to identify a series when a legend symbol is clicked.
Returns:
An integer number.
See Also:
SerieListener, GenericGraph.addSerieListener(com.jinsight.jetchart.SerieListener), Graph.setSerieDraggingEnabled(boolean)

isOverLegend

public boolean isOverLegend()
Indicates whether a legend symbol was clicked or not.
Returns:
A boolean value.

getX

public int getX()
Returns the x coordinate of the mouse cursor when a series is clicked or dragged.
Returns:
An integer number.

getY

public int getY()
Returns the y coordinate of the mouse cursor when a series is clicked or dragged.
Returns:
An integer value.

getClickCount

public int getClickCount()
Returns the number of quick, consecutive clicks on a series data point.
Returns:
An integer number.

finalize

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