|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart3djava.ChartObj
com.quinncurtis.chart3djava.GraphObj
com.quinncurtis.chart3djava.ChartMouseListener
com.quinncurtis.chart3djava.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. |
|
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 default drawing routine for the data tooltip. |
int |
errorCheck(int nerror)
Checks the DataToolTip object for common errors. |
ChartPlot |
findObj(ChartPoint3D testpoint)
This method finds the plot object nearest the test point. |
ChartPoint3D |
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. |
ChartPoint3D |
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. |
boolean |
getToolTipActive()
Get the toolTipActiveFlag. |
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 |
setToolTipActive(boolean value)
Set toolTipActiveFlag |
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.chart3djava.ChartMouseListener |
---|
addChartMouseListener, checkIntersection, copy, getButtonMask, getEnable, getMouseListenerEnable, mouseEntered, mouseExited, mouseMoved, removeChartMouseListener, setButtonMask, setEnable, setMouseListenerEnable |
Methods inherited from class com.quinncurtis.chart3djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID |
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 int errorCheck(int nerror)
errorCheck
in class ChartMouseListener
nerror
- Current error state.
public void copy(DataToolTip source)
source
- The source DataToolTip object.public java.lang.Object clone()
clone
in class ChartMouseListener
public void addDataToolTipListener()
public void removeDataToolTipListener()
public java.lang.String makeDefaultDataToolTipString()
public void draw(java.awt.Graphics2D g2)
draw
in class ChartMouseListener
g2
- graphics contextpublic 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 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 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 ChartPlot findObj(ChartPoint3D testpoint)
testpoint
- The current position of the mouse in window device coordinates.
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 double getHitTestThreshold()
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 ChartText getTextTemplate()
public void setXValueTemplate(ChartLabel xvalue1template)
xvalue1template
- Specifies the numeric format used to display the x-value in the tooltip.public ChartLabel getXValueTemplate()
public void setYValueTemplate(ChartLabel yvalue1template)
yvalue1template
- Specifies the numeric format used to display the y-value in the tooltip.public ChartLabel getYValueTemplate()
public void setToolTipSymbol(ChartSymbol symbol)
symbol
- Specifies the tootip symbol used to highlight the tooltip data point.public ChartSymbol getToolTipSymbol()
public java.awt.Graphics2D getToolTipGraphics()
public void setDataToolTipFormat(int format)
format
- Specifies the format of the tooltip display.public int getDataToolTipFormat()
public ChartPoint3D getNearestDataValue()
public ChartPoint3D getActualCursorPosition()
public PhysicalCoordinates getSelectedCoordinateSystem()
public ChartPlot getSelectedPlotObj()
public ChartDataset getSelectedDataset()
public NearestPointData getNearestPoint()
public void setOHLCStrings(java.lang.String[] ohlcstrings)
ohlcstrings
- Array of strings for lableing the values in the data tooltip.public java.lang.String[] getOHLCStrings()
public void setToolTipActive(boolean value)
value
- Set the toolTipActiveFlag.public boolean getToolTipActive()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |