com.jinsight.jetchart
Class ScrollingLabel

java.lang.Object
  |
  +--com.jinsight.jetchart.ScrollingLabel

public class ScrollingLabel
extends java.lang.Object

A scrolling label is a text that slides horizontally across a vertical chart, displaying the chart labels. When the x coordinate of the mouse cursor is equal to the x coordinate of a label mark placed on the x axis, the scrolling label is displayed.
The scrolling label is useful in that charts displaying a large number of data points automatically hide most part of the labels to prevent them from overlapping each other, so the scrolling label overcomes this problem displaying the label corresponding to the data point the mouse cursor is moving on.
The scrolling label can be displayed at the chart top position, just above the starting point of the vertical axis, or above the horizontal axis. If a label has more than one line the scrolling label displays the widest line.

The scrolling label is only displayed if chart is 2D and orientation is vertical. It has no public constructor and can only be accessed through a 'get' method implemented in the Graph class.

See Also:
Graph.getScrollingLabel()

Field Summary
static int ABOVE_XAXIS
          Constant used to display the scrolling label above the x axis.
static int TOP_YAXIS
          Constant used to display the scrolling label at the top of the y axis.
 
Method Summary
protected  void finalize()
           
 void setColor(java.awt.Color color)
          Sets the color of the scrolling label.
 void setDescription(java.lang.String description)
          Sets a single line of text to be prefixed to the scrolling label.
 void setEnabled(boolean isEnabled)
          Enables/disables the scrolling label.
 void setFont(java.awt.Font font)
          Sets the font of the scrolling label.
 void setPosition(int position)
          Sets the scrolling label position.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP_YAXIS

public static final int TOP_YAXIS
Constant used to display the scrolling label at the top of the y axis.

ABOVE_XAXIS

public static final int ABOVE_XAXIS
Constant used to display the scrolling label above the x axis.
Method Detail

setDescription

public void setDescription(java.lang.String description)
Sets a single line of text to be prefixed to the scrolling label. It gives a description of the label content.
Parameters:
description - A String object.

setEnabled

public void setEnabled(boolean isEnabled)
Enables/disables the scrolling label. The scrolling label is only displayed if chart is 2D and orientation is vertical.
Parameters:
isEnabled - A boolean value(true/false).
See Also:
Graph.setHorizontalGraphEnabled(boolean), GenericGraph.set3DEnabled(boolean)

setColor

public void setColor(java.awt.Color color)
Sets the color of the scrolling label.
Parameters:
color - A Color object.

setPosition

public void setPosition(int position)
Sets the scrolling label position. The scrolling label can be positioned above the starting point of the vertical axis or right above the x axis. The scrolling label is by default positioned above the starting point of the vertical axis.
Parameters:
position - One of the constants used to set the scrolling label position.
See Also:
TOP_YAXIS, ABOVE_XAXIS

setFont

public void setFont(java.awt.Font font)
Sets the font of the scrolling label.
Parameters:
font - A Font object.

finalize

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