|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart2djava.ChartObj
com.quinncurtis.chart2djava.GraphObj
com.quinncurtis.chart2djava.ChartMouseListener
com.quinncurtis.chart2djava.DataToolTip
public class DataToolTip
The DataToolTip class extends the MouseListener class, providing additional methods that allow the user to popup a simple tooltip window displaying the x- and y-values of a data point. This class looks at the actually underlying data values of a plot objects dataset. It does not take into account data objects that use a stacked format: StackedBarPlot and StackedLinePlot.
Field Summary |
---|
Constructor Summary | |
---|---|
DataToolTip()
The default DataToolTip constructor. |
|
DataToolTip(ChartView component)
This constructor creates a new DataToolTip object using the specified component and scale. |
|
DataToolTip(ChartView component,
int buttonmask)
This constructor creates a new DataToolTip object using the specified component and scale. |
Method Summary | |
---|---|
void |
addDataToolTipListener()
This method installs the DChartDataToolTip object by adding it to the mouse listener list of the ChartView component. |
java.lang.Object |
clone()
Returns an object that is a clone of this DataToolTip object. |
void |
copy(DataToolTip source)
Copies the source DataToolTip. |
void |
draw(java.awt.Graphics2D g2)
The draw method for this class. |
int |
errorCheck(int nerror)
Checks the DataToolTip object for common errors. |
ChartPlot |
findObj(ChartPoint2D testpoint)
This method finds the plot object nearest the test point. |
ChartPoint2D |
getActualCursorPosition()
In the mousePressed event, this function will return the actual mouse cursor position, in the physical units of the associated plot object. |
int |
getDataToolTipFormat()
Returns the format of the tooltip display. |
double |
getHitTestThreshold()
Returns the threshold distance used to determine if the test point is close enough to at data point to be considered a hit. |
ChartPoint2D |
getNearestDataValue()
In the mousePressed event, this function will return the xy data point nearest the mouse cursor position. |
NearestPointData |
getNearestPoint()
In the mousePressed event, this function will return information about1 the the search for the nearest data point. |
java.lang.String[] |
getOHLCStrings()
Get the strings used to differentiate the x, open, high, low and close values in the DATA_TOOLTIP_OHLC tooltip type. |
PhysicalCoordinates |
getSelectedCoordinateSystem()
In the mousePressed event, this function will return the coordinate system of the selected plot object. |
ChartDataset |
getSelectedDataset()
In the mousePressed event, this function will return the selected plot objects dataset. |
ChartPlot |
getSelectedPlotObj()
In the mousePressed event, this function will return the selected plot object. |
ChartText |
getTextTemplate()
Returns a reference to the tootip text template. |
java.awt.Graphics2D |
getToolTipGraphics()
Returns a reference to the graphics object used by the tooltip class. |
ChartSymbol |
getToolTipSymbol()
Returns a reference to the tootip symbol used to highlight the tooltip data point. |
ChartLabel |
getXValueTemplate()
Returns a reference to the tootip x-value template. |
ChartLabel |
getYValueTemplate()
Returns a reference to the tootip y-value template. |
java.lang.String |
makeDefaultDataToolTipString()
Makes the default data tooltip string used by the DATA_TOOLTIP_X, DATA_TOOLTIP_Y, DATA_TOOLTIP_XY_ONELINE, DATA_TOOLTIP_TWOLINE formats. |
void |
mouseClicked(java.awt.event.MouseEvent event)
Dummy event listener for this object. |
void |
mouseDragged(java.awt.event.MouseEvent event)
The mouseDragged event listener for this object. |
void |
mousePressed(java.awt.event.MouseEvent event)
The mousePressed event listener for this object. |
void |
mouseReleased(java.awt.event.MouseEvent event)
The mouseReleased event listener for this object. |
void |
removeDataToolTipListener()
This method disables the data cursor object by removing it to/from the mouse listener list of the ChartView component. |
void |
setDataToolTipFormat(int format)
Specifies the format of the tooltip display. |
void |
setHitTestThreshold(double nearvalue)
A data point must be within a threshold distance of the test point, in DEV_POS coordinates in order for it to be considered a hit. |
void |
setOHLCStrings(java.lang.String[] ohlcstrings)
Set the strings used to differentiate the x, open, high, low and close values in the DATA_TOOLTIP_OHLC tooltip type. |
void |
setTextTemplate(ChartText texttemplate)
Sets the tootip text template. |
void |
setToolTipSymbol(ChartSymbol symbol)
Sets the tootip symbol used to highlight the tooltip data point. |
void |
setXValueTemplate(ChartLabel xvalue1template)
Sets the tootip x-value template. |
void |
setYValueTemplate(ChartLabel yvalue1template)
Sets the tootip y-value template. |
Methods inherited from class com.quinncurtis.chart2djava.ChartMouseListener |
---|
addChartMouseListener, checkIntersection, copy, getButtonMask, getEnable, getMouseListenerEnable, mouseEntered, mouseExited, mouseMoved, removeChartMouseListener, setButtonMask, setEnable, setMouseListenerEnable |
Methods inherited from class com.quinncurtis.chart2djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID, TypeSafeVectorCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataToolTip()
public DataToolTip(ChartView component)
component
- A reference to the ChartView object that the chart is placed in.public DataToolTip(ChartView component, int buttonmask)
component
- A reference to the ChartView object that the chart is placed in.buttonmask
- Specifies the mouse button that is trapped to invoke a move.Method Detail |
---|
public void addDataToolTipListener()
public java.lang.Object clone()
clone
in class ChartMouseListener
public void copy(DataToolTip source)
source
- The source DataToolTip object.public void draw(java.awt.Graphics2D g2)
ChartMouseListener
draw
in class ChartMouseListener
g2
- The graphics context.public int errorCheck(int nerror)
errorCheck
in class ChartMouseListener
nerror
- Current error state.
public ChartPlot findObj(ChartPoint2D testpoint)
testpoint
- The current position of the mouse in window device coordinates.
public ChartPoint2D getActualCursorPosition()
public int getDataToolTipFormat()
public double getHitTestThreshold()
public ChartPoint2D getNearestDataValue()
public NearestPointData getNearestPoint()
public java.lang.String[] getOHLCStrings()
public PhysicalCoordinates getSelectedCoordinateSystem()
public ChartDataset getSelectedDataset()
public ChartPlot getSelectedPlotObj()
public ChartText getTextTemplate()
public java.awt.Graphics2D getToolTipGraphics()
public ChartSymbol getToolTipSymbol()
public ChartLabel getXValueTemplate()
public ChartLabel getYValueTemplate()
public java.lang.String makeDefaultDataToolTipString()
public void mouseClicked(java.awt.event.MouseEvent event)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mousePressed(java.awt.event.MouseEvent event)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class ChartMouseListener
event
- The mouse event contains status information about the mouse.public void removeDataToolTipListener()
public void setDataToolTipFormat(int format)
format
- Specifies the format of the tooltip display.public void setHitTestThreshold(double nearvalue)
nearvalue
- A data point must be within this threshold distance of the test point, in DEV_POS
coordinates in order for it to be considered a hit.public void setOHLCStrings(java.lang.String[] ohlcstrings)
public void setTextTemplate(ChartText texttemplate)
texttemplate
- An instance of an ChartText object that has been initialized so that the font,
font size, color and justification parameters represent a template for the display of the tooltip values.public void setToolTipSymbol(ChartSymbol symbol)
symbol
- Specifies the tootip symbol used to highlight the tooltip data point.public void setXValueTemplate(ChartLabel xvalue1template)
xvalue1template
- Specifies the numeric format used to display the x-value in the tooltip.public void setYValueTemplate(ChartLabel yvalue1template)
yvalue1template
- Specifies the numeric format used to display the y-value in the tooltip.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |