com.ijchart.xychart.tooltip
Class DefaultTooltipGenerator

java.lang.Object
  extended by com.ijchart.xychart.tooltip.AbstractToolTipGeneratorAdapter
      extended by com.ijchart.xychart.tooltip.DefaultTooltipGenerator
All Implemented Interfaces:
IToolTipGenerator, java.io.Serializable, java.lang.Cloneable

public class DefaultTooltipGenerator
extends AbstractToolTipGeneratorAdapter
implements IToolTipGenerator, java.lang.Cloneable, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

The default tooltip generator of a chart shape,this class is immutable.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
static boolean DEFAULT_TOOLTIP_GENERATOR_GROUP
           The default flag controls whether or not the data type is group.
 
Constructor Summary
DefaultTooltipGenerator()
           No argument constructor.
DefaultTooltipGenerator(boolean group)
           No argument constructor.
DefaultTooltipGenerator(IChartDataFormatter formatter)
           Constructor.
DefaultTooltipGenerator(IChartDataFormatter formatter, boolean group)
           Constructor.
 
Method Summary
protected  java.lang.Object clone()
           Creates and returns a copy of this object.
 boolean equals(java.lang.Object obj)
           Tests this object for equality with an arbitrary object.
 java.lang.String generateGroupToolTip(IMatrixDataset dataset, int row, int column, int index)
           Returns this data formatter.
 int hashCode()
           Returns a hash code.
 boolean isGroup()
           The flag controls whether or not the data type is group.
 java.lang.String toString()
           Returns a string representation of this Range.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TOOLTIP_GENERATOR_GROUP

public static final boolean DEFAULT_TOOLTIP_GENERATOR_GROUP
The default flag controls whether or not the data type is group.

See Also:
Constant Field Values
Constructor Detail

DefaultTooltipGenerator

public DefaultTooltipGenerator()
No argument constructor.


DefaultTooltipGenerator

public DefaultTooltipGenerator(boolean group)
No argument constructor.

Parameters:
group - boolean The flag controls whether or not the data type is group.

DefaultTooltipGenerator

public DefaultTooltipGenerator(IChartDataFormatter formatter)
Constructor.

Parameters:
formatter - IFormatter The data formatter (null permitted).

DefaultTooltipGenerator

public DefaultTooltipGenerator(IChartDataFormatter formatter,
                               boolean group)
Constructor.

Parameters:
formatter - IFormatter The data formatter (null permitted).
group - boolean The flag controls whether or not the data type is group.
Method Detail

getFormatter

public IChartDataFormatter getFormatter()
Returns this data formatter.

Returns:
IChartDataFormatter The data formatter (maybe null).

isGroup

public boolean isGroup()
The flag controls whether or not the data type is group.

Specified by:
isGroup in interface IToolTipGenerator
Returns:
boolean A boolean.

generateToolTip

public java.lang.String generateToolTip(IMatrixDataset dataset,
                                        int row,
                                        int column)
Generates a label for the specified item. The tooltip is typically a formatted version of the data value, but any text can be used.

Specified by:
generateToolTip in interface IToolTipGenerator
Overrides:
generateToolTip in class AbstractToolTipGeneratorAdapter
Parameters:
dataset - IMatrixDataset The dataset (null not permitted).
row - int The dataset row number,must be greater than or equal to 0.
column - int The dataset column number,must be greater than or equal to 0.
Returns:
String The tooltip text (possibly null).

generateGroupToolTip

public java.lang.String generateGroupToolTip(IMatrixDataset dataset,
                                             int row,
                                             int column,
                                             int index)
Generates a tooltip for the specified item. The tooltip is typically a formatted version of the data value, but any text can be used.

Specified by:
generateGroupToolTip in interface IToolTipGenerator
Overrides:
generateGroupToolTip in class AbstractToolTipGeneratorAdapter
Parameters:
dataset - IMatrixDataset The dataset (null not permitted).
row - int The dataset row number,must be greater than or equal to 0.
column - int The dataset column number,must be greater than or equal to 0.
index - int The index of a dataset data.
Returns:
String The tooltip text (possibly null).

equals

public boolean equals(java.lang.Object obj)
Tests this object for equality with an arbitrary object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to test against (null permitted).
Returns:
A boolean.

hashCode

public int hashCode()
Returns a hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code.

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class java.lang.Object
Returns:
object a clone of this instance.
Throws:
java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

toString

public java.lang.String toString()
Returns a string representation of this Range.

Overrides:
toString in class java.lang.Object
Returns:
A String.