lt.monarch.chart.plugins
Class ValueMarkerPainter

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

public class ValueMarkerPainter
extends AbstractChartPlugin<Chart2D>
implements java.awt.event.MouseMotionListener, java.awt.event.MouseListener

Plug-in for Chart2D LineSeries, which implements line value markers showing

See Also:
Serialized Form

Constructor Summary
Constructor and Description
ValueMarkerPainter(LineSeries lineSeries, Axis2D axisX, Axis2D axisY)
          Constructs a new LineSeriesValueMarkerPainter for the specified line series and axes.
ValueMarkerPainter(LineSeries lineSeries, Axis2D axisX, Axis2D axisY, java.awt.Color markerColor, java.awt.Color labelColor, java.awt.Font labelFont, int numbersPrecision, java.util.Locale locale)
          Constructs a new LineSeriesValueMarkerPainter for the specified line series and axes.
 
Method Summary
Modifier and Type Method and Description
 void activate()
          Prepares the plug-in, when it is installed.
protected  java.lang.String assemblePointText(java.lang.Object objectX, java.lang.Object objectY)
           
 void deactivate()
          Cleanups the plug-in, when it is uninstalled.
 java.awt.Color getLabelColor()
          Gets the label color
 java.awt.Font getLabelFont()
          Gets the label font
 java.util.Locale getLocale()
          Gets locale for axis with Number or Date values
 java.awt.Color getMarkerColor()
          Gets the marker color
 int getNumbersPrecision()
          Gets number precision for axis with Number values
 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)
           
 void paint(AbstractGraphics g)
          Does nothing- must be overridden in extending classes.
 void setLabelColor(java.awt.Color labelColor)
          Sets the label color
 void setLabelFont(java.awt.Font labelFont)
          Sets the label font
 void setLocale(java.util.Locale locale)
          Sets locale for axis with Number or Date values
 void setMarkerColor(java.awt.Color markerColor)
          Sets the marker color
 void setNumbersPrecision(int numbersPrecision)
          Sets number precision for axis with Number values
 
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

ValueMarkerPainter

public ValueMarkerPainter(LineSeries lineSeries,
                          Axis2D axisX,
                          Axis2D axisY)
Constructs a new LineSeriesValueMarkerPainter for the specified line series and axes.

Parameters:
lineSeries - line series
axisX - x Axis
axisY - y Axis

ValueMarkerPainter

public ValueMarkerPainter(LineSeries lineSeries,
                          Axis2D axisX,
                          Axis2D axisY,
                          java.awt.Color markerColor,
                          java.awt.Color labelColor,
                          java.awt.Font labelFont,
                          int numbersPrecision,
                          java.util.Locale locale)
Constructs a new LineSeriesValueMarkerPainter for the specified line series and axes.

Parameters:
lineSeries - line series
axisX - x Axis
axisY - y Axis
markerColor - marker line color
labelColor - marker label color
labelFont - marker label font
numbersPrecision - number precision for Number type axis
locale - locale for label values converting
Method Detail

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<Chart2D>

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<Chart2D>

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

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<Chart2D>
Overrides:
paint in class AbstractChartPlugin<Chart2D>
Parameters:
g - the Graphics context in which chart is painted
See Also:
ChartPlugin.paint(lt.monarch.chart.engine.AbstractGraphics)

assemblePointText

protected java.lang.String assemblePointText(java.lang.Object objectX,
                                             java.lang.Object objectY)

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

setMarkerColor

public void setMarkerColor(java.awt.Color markerColor)
Sets the marker color

Parameters:
markerColor - Marker color

getMarkerColor

public java.awt.Color getMarkerColor()
Gets the marker color

Returns:
The marker color

getLabelColor

public java.awt.Color getLabelColor()
Gets the label color

Returns:
the labelColor

setLabelColor

public void setLabelColor(java.awt.Color labelColor)
Sets the label color

Parameters:
labelColor - the labelColor to set

getLabelFont

public java.awt.Font getLabelFont()
Gets the label font

Returns:
the labelFont

setLabelFont

public void setLabelFont(java.awt.Font labelFont)
Sets the label font

Parameters:
labelFont - the labelFont to set

getNumbersPrecision

public int getNumbersPrecision()
Gets number precision for axis with Number values

Returns:
the numbersPrecision

setNumbersPrecision

public void setNumbersPrecision(int numbersPrecision)
Sets number precision for axis with Number values

Parameters:
numbersPrecision - the numbersPrecision to set

getLocale

public java.util.Locale getLocale()
Gets locale for axis with Number or Date values

Returns:
the locale

setLocale

public void setLocale(java.util.Locale locale)
Sets locale for axis with Number or Date values

Parameters:
locale - the locale to set