lt.monarch.chart.plugins
Class AxisLabelsURLSupport

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

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

This plug-in adds linking functionality to labels of 2D axis. When user clicks on one of axis labels, plug-in asks URL for this link from AxisLabelsURLProvider instance and launches new browser window with given URL.

See Also:
Serialized Form

Constructor Summary
Constructor and Description
AxisLabelsURLSupport(Axis2D axis, AxisLabelsURLProvider provider)
          Constructs plug-in for given 2D axis with given URL provider.
 
Method Summary
Modifier and Type Method and Description
 void activate()
          Activates the plug-in.
 void deactivate()
          Deactivates the plug-in.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 
Methods inherited from class lt.monarch.chart.plugins.AbstractChartPlugin
adjustChart, chart, getChart, install, isActivated, paint, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxisLabelsURLSupport

public AxisLabelsURLSupport(Axis2D axis,
                            AxisLabelsURLProvider provider)
Constructs plug-in for given 2D axis with given URL provider.

Parameters:
axis - axis, which labels will have linking behavior
provider - should return URLs for labels
Method Detail

activate

public void activate()
Activates the plug-in. Registers mouse and mouse motion listeners.

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

deactivate

public void deactivate()
Deactivates the plug-in. Unregisters mouse and mouse motion listeners.

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

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

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

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener