lt.monarch.chart.plugins
Class LegendSelector

java.lang.Object
  extended by lt.monarch.chart.plugins.AbstractChartPlugin<AbstractChart<?,?>>
      extended by lt.monarch.chart.plugins.LegendSelector
All Implemented Interfaces:
java.awt.event.MouseListener, java.io.Serializable, java.util.EventListener, ChartPlugin<AbstractChart<?,?>>

public class LegendSelector
extends AbstractChartPlugin<AbstractChart<?,?>>
implements java.awt.event.MouseListener

Legend entry selector. When legend entry is selected the corresponding series is also selected. This of course works only for Legend. When the same entry is clicked again it is deselected with its corresponding series.

See Also:
Serialized Form

Constructor Summary
Constructor and Description
LegendSelector(AbstractChartSeries<?,?>[] series)
          Deprecated. does nothing
LegendSelector(AbstractLegend legend)
          Constructs a drill down plug-in.
 
Method Summary
Modifier and Type Method and Description
 void activate()
          Prepares the plug-in, when it is installed.
 void addActionListener(java.awt.event.ActionListener l)
          Installs an action listener.
 void deactivate()
          Cleanups the plug-in, when it is uninstalled.
protected  void fireActionPerformed(java.lang.String command)
          Notifies the listeners that action event occurred.
 ChartEntity getSelectedEntity()
          Returns last selected chart entity.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void paint(AbstractGraphics g)
          Does nothing- must be overridden in extending classes.
 void removeActionListener(java.awt.event.ActionListener l)
          Uninstalls an action listener.
 
Methods inherited from class lt.monarch.chart.plugins.AbstractChartPlugin
adjustChart, chart, getChart, install, isActivated, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegendSelector

public LegendSelector(AbstractLegend legend)
Constructs a drill down plug-in.


LegendSelector

@Deprecated
public LegendSelector(AbstractChartSeries<?,?>[] series)
Deprecated. does nothing

Constructs a drill down plug-in for specified chart series.

Parameters:
series - array of AbstractChartSeries
Method Detail

getSelectedEntity

public ChartEntity getSelectedEntity()
Returns last selected chart entity.

Returns:
entity last selected chart entity

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Installs an action listener. The listener is fired, when the user selects a selectable chart object.

Parameters:
l - action listener

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Uninstalls an action listener.

Parameters:
l - action listener

fireActionPerformed

protected void fireActionPerformed(java.lang.String command)
Notifies the listeners that action event occurred.

Parameters:
command - action command

activate

public void activate()
Description copied from class: AbstractChartPlugin
Prepares the plug-in, when it is installed. Also called when chart is activated.

Specified by:
activate in class AbstractChartPlugin<AbstractChart<?,?>>

deactivate

public void deactivate()
Description copied from class: AbstractChartPlugin
Cleanups the plug-in, when it is uninstalled. Also called when chart is deactivated.

Specified by:
deactivate in class AbstractChartPlugin<AbstractChart<?,?>>

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

paint

public void paint(AbstractGraphics g)
Description copied from class: AbstractChartPlugin
Does nothing- must be overridden in extending classes.

Specified by:
paint in interface ChartPlugin<AbstractChart<?,?>>
Overrides:
paint in class AbstractChartPlugin<AbstractChart<?,?>>
Parameters:
g - the Graphics context in which chart is painted
See Also:
ChartPlugin.paint(lt.monarch.chart.engine.AbstractGraphics)