lt.monarch.chart.plugins
Class AxisMarker

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

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

Plug-in for 2D charts, which implements axis markers.

See Also:
Serialized Form

Constructor Summary
Constructor and Description
AxisMarker(Axis2D axisX, Axis2D axisY)
          Constructs a new AxisMarker for the specified axes.
AxisMarker(Axis2D axisX, Axis2D axisY, java.awt.Color markerColor, java.awt.Color labelColor, int size, AxisLabelPaint xAxisTextPaintingMode, AxisLabelPaint yAxisTextPaintingMode, int numbersPrecision)
          Constructs a new AxisMarker for the specified axes with the specified attributes.
 
Method Summary
Modifier and Type Method and Description
 void activate()
          Activates the chart plug-in.
 void deactivate()
          Deactivates the chart plug-in.
 void drawMarkers(AbstractGraphics g, java.awt.Point point)
          Paints the axis markers and value labels at the the intersection with the specified point.
 java.awt.Color getLabelColor()
          Returns the current value label color.
 java.util.Locale getLocale()
          Returns the current locale of the value labels.
 java.awt.Color getMarkerColor()
          Returns the current marker toFill color.
 int getMarkerSize()
          Returns current marker size.
 int getNumberPrecision()
          Returns the current number precision of the value labels.
 void mouseClicked(java.awt.event.MouseEvent me)
          Invoked when a mouse button has been clicked on a chart.
 void mouseDragged(java.awt.event.MouseEvent me)
          Invoked when a mouse button is pressed on a chart and then dragged.
 void mouseEntered(java.awt.event.MouseEvent me)
          Invoked when the mouse enters a chart.
 void mouseExited(java.awt.event.MouseEvent me)
          Invoked when the mouse exits a chart.
 void mouseMoved(java.awt.event.MouseEvent me)
          Invoked when the mouse button has been moved on a chart (with no buttons no down).
 void mousePressed(java.awt.event.MouseEvent me)
          Invoked when a mouse button has been pressed on a chart.
 void mouseReleased(java.awt.event.MouseEvent me)
          Invoked when a mouse button has been released.
 void paint(AbstractGraphics g)
          If needed, paints axis markers at the intersection with the mouse pointer points.
 void setLabelColor(java.awt.Color color)
          Sets the value label color.
 void setLocale(java.util.Locale locale)
          Sets the locale for the value labels.
 void setMarkerColor(java.awt.Color color)
          Sets the marker toFill color.
 void setMarkerSize(int size)
          Sets the marker size.
 void setNumberPrecision(int precision)
          Sets number precision for the value labels.
 
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

AxisMarker

public AxisMarker(Axis2D axisX,
                  Axis2D axisY)
Constructs a new AxisMarker for the specified axes.

Parameters:
axisX - the X axis
axisY - the Y axis

AxisMarker

public AxisMarker(Axis2D axisX,
                  Axis2D axisY,
                  java.awt.Color markerColor,
                  java.awt.Color labelColor,
                  int size,
                  AxisLabelPaint xAxisTextPaintingMode,
                  AxisLabelPaint yAxisTextPaintingMode,
                  int numbersPrecision)
Constructs a new AxisMarker for the specified axes with the specified attributes.

Parameters:
axisX - the X axis
axisY - the Y axis
markerColor - color of the marker
labelColor - color of the value labels
size - the marker size
xAxisTextPaintingMode - the value label on X axis painting mode; should be one of: HORIZONTAL_TEXT and VERTICAL_TEXT
yAxisTextPaintingMode - the value label on Y axis painting mode; should be one of: HORIZONTAL_TEXT and VERTICAL_TEXT
numbersPrecision - the precision of numeric values displayed as labels
Method Detail

activate

public void activate()
Activates the chart plug-in.

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

deactivate

public void deactivate()
Deactivates the chart plug-in.

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

setMarkerSize

public void setMarkerSize(int size)
Sets the marker size.

Parameters:
size - the new size of marker

getMarkerSize

public int getMarkerSize()
Returns current marker size.

Returns:
the current marker size

setMarkerColor

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

Parameters:
color - the new marker toFill color

getMarkerColor

public java.awt.Color getMarkerColor()
Returns the current marker toFill color.

Returns:
the current marker toFill color

setLabelColor

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

Parameters:
color - the new value label color

getLabelColor

public java.awt.Color getLabelColor()
Returns the current value label color.

Returns:
the current value label color

setNumberPrecision

public void setNumberPrecision(int precision)
Sets number precision for the value labels.

Parameters:
precision - the new number precision

getNumberPrecision

public int getNumberPrecision()
Returns the current number precision of the value labels.

Returns:
the current number precision of the value labels

setLocale

public void setLocale(java.util.Locale locale)
Sets the locale for the value labels. The value labels will be formated according to this locale.

Parameters:
locale - the new locale

getLocale

public java.util.Locale getLocale()
Returns the current locale of the value labels.

Returns:
the current locale of the value labels

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Invoked when a mouse button has been pressed on a chart. If me.getModifiers() == java.awt.event.InputEvent.BUTTON3_MASK, paints the axes markers and value labels at the intersection with the mouse pointer points.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
me - mouse event

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Invoked when a mouse button has been released.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
me - mouse event

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Invoked when a mouse button has been clicked on a chart. Does nothing.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
me - mouse event

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent me)
Invoked when the mouse enters a chart. Does nothing.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
me - mouse event

mouseExited

public void mouseExited(java.awt.event.MouseEvent me)
Invoked when the mouse exits a chart. Does nothing.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
me - mouse event

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me)
Invoked when a mouse button is pressed on a chart and then dragged. If me.getModifiers() == java.awt.event.InputEvent.BUTTON3_MASK, then paints the axes markers and value labels at the intersection with the mouse pointer points.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
me - mouse event

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent me)
Invoked when the mouse button has been moved on a chart (with no buttons no down). Does nothing.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
me - mouse event

drawMarkers

public void drawMarkers(AbstractGraphics g,
                        java.awt.Point point)
Paints the axis markers and value labels at the the intersection with the specified point.

Parameters:
g - the Graphics context in which to paint axis markers
point - the point

paint

public void paint(AbstractGraphics g)
If needed, paints axis markers at the intersection with the mouse pointer points.

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