Chapter 10.
Abstract Classes & Interfaces


 

This chapter describes the functions that are defined in the Perspective abstract interface. If you use any of these interfaces, your application must implement these function in the format described in this chapter.

 

tdg Class NumberFormatCallback Class

 

tdg.data.in Interface TDGDataCallbackIF Interface

 

tdg.data.in Interface TDGDataGrid Interface

 

tdg.data.in Interface TDGDataGridPieBar Interface

 

tdg.event Class TDGEvent Class

 

tdg.event Interface TDGListener Interface

 

tdg Interface TDGNestedLabel Interface

 

tdg.data.in Interface TDGPreScaleIF Interface

 

tdg Interface ToolTipCallback Interface

NumberFormatCallBack Class

 

The NumberFormatCallBack class defines the following static variables and methods:

 

public static final int AXIS_LABEL

 

public static final int PIE_LABEL

 

public static final int PIE_TOTAL

 

public static final int DATA_LABEL

 

public static final int TOOLTIP_VALUE

 

public static final int DATA_LABEL_HILO_VOL

 

void init(Perspective a PerspectiveInstance); Initialize a perspective instance.

 

void setState(int LabelType, int Series, int Group, tdg.AxisTemplate Axis_ID, int Axis_Ord); Reserved for internal use.

 

String toString(double dVal); Convert a double value to a string. This function must be implemented by your application.

 

The NumberFormatCallback class represents an abstract interface to an object that formats the numbers in a Perspective for Java chart. To use this class, do the following:

 

subclass NumberFormatCallback

 

override the toString() method to format the numbers as required by your application.

 

call setNumberFormatCallBack() to register the "number format callback" object

 

You may also use:

 

getNumberFormatCallBack() to determine if a NumberFormatCallBack has been assigned with setNumberFormatCallBack()

 

isNumberFormatCallBack() to determine if an object is a number format callback

 

The following methods can be used to view information that is set by the reserved setState() method:

 

protected int getSeries()

 

protected int getGroup()

 

protected int getLabelType()

 

protected boolean isAxisLabel()

 

protected boolean isY1AxisLabel()

 

protected boolean isY2AxisLabel()

 

protected boolean isX1AxisLabel()

 

protected int getAxisLabelOrdinalPosition()

 

The following example program shows a simple implementation of the NumberFormatCallback interface:

import tdg.NumberFormatCallBack;
/* The PfjNumberFormatCallback class.
* Class PfjNumberFormatCallback extends the
* Perspective NumberFormatCallBack class */
public class PfjNumberFormatCallback extends
NumberFormatCallBack
{
    // PfjNumberFormatCallback
    // PUBLIC MEMBER FUNCTIONS
    //------------------------------------------------
    public String toString( double dVal )
    {
        String labelType;
        String resultValue;
        String axisValue;
        String dataValue;
        switch ( getLabelType() )
        { // switch on labelType
            case AXIS_LABEL:
                labelType = "Axis";
                break;
            case PIE_LABEL:
                labelType = "Slice";
                break;
            case PIE_TOTAL:
                labelType = "PieT";
                break;
            case DATA_LABEL:
                labelType = "Data";
                break;
            case TOOLTIP_VALUE:
                labelType = "ToolTip";
                break;
            default:
                labelType = "BadLabelType";
                System.out.println("Undefined LabelType = "
                + getLabelType() + " Value = " + dVal);
                break;
            } // switch on labelType

        if ( isAxisLabel() )
        {
            
                if(isY1AxisLabel())axisValue = "Y1" + ";" +
                    getAxisLabelOrdinalPosition();
                else
                if(isY2AxisLabel())axisValue = "Y2" + ";" +
                    getAxisLabelOrdinalPosition();
                else
                if(isX1AxisLabel())axisValue = "X1" + ";" +
                    getAxisLabelOrdinalPosition();
                else
                    axisValue = "BadAxis";
        }

        else axisValue = "NA";
        if ( dVal > 1 || dVal == 0 )
            dataValue = new Double(dVal).toString();
        else
            dataValue = new Integer((int)
                (dVal * 100 + .5)).toString() + "%";

        resultValue = labelType + ";" + getSeries() +
            ";" + getGroup() + ";" +
            axisValue + ":" + dataValue;
            return resultValue;
    }
} // PfjNumberFormatCallback

init()

This method is used to initialize a Perspective instance for the NumberFormatCallback interface.

Syntax:

void init(Perspective aPerspectiveInstance)

Input:

aPerspectiveInstance; a Perspective Instance

Return:

void;

Example:

public void init( Perspective aPerspectiveInstance )
{
    m_Perspective = aPerspectiveInstance;
}

Also See:

toString(), getNumberFormatCallBack(), isNumberFormatCallBack(), setNumberFormatCallBack()

toString()

This function converts the double value identified by dVal to a string using a user-defined criteria. This function must be created by your NumberFormatCallback interface to format numeric labels as required by your application.

Syntax:

String toString(double dVal)

Input:

dVal; a double value

Return:

String;

Example:

public String toString( double dVal )
{
    // The string you return and the hoops you jump
    // through to compute it should be more
    // sophisticated than the following:
    //
    // return new Double(dVal).toString();
    //
    return "Never";
}

Also See:

getNumberFormatCallBack(), isNumberFormatCallBack(), setNumberFormatCallBack()

TDGDataCallbackIF Interface

This interface defines a group of methods that can be used to get and set data in a chart when the setDataFromCallBack() method is used to slave chart data to an arbitrary Java Object.

 

java.lang.String columnLabel(int c)

 

int getColumns()

 

int getRows()

 

java.lang.Object getValue(int r, int c)

 

java.lang.String rowLabel(int r)

These methods are identical to the methods defined in the TDGDataGrid interface.

TDGDataGrid Interface

TDGDataGrid is an abstract interface. It defines a series of methods that you must implement into an object. The TDGDataGrid interface represents an abstract data model that is one way of preparing data for graphing. Use these methods to enable this interface.

 

setDataFromCallBack(TDGDataGrid grid); Enable the chart data to be slaved to an arbitrary Java Object which implements the TDGDataGrid Interface

 

setDataFromDataGrid(TDGDataGrid grid); Tell the charting engine to use the TDGDataGrid object to collect data for the chart.

You may also use getDataGridCallback() to get the TDGDataGrid interface defined by setDataFromDataGrid()

The TDGDataGrid interface defines these methods that must be implemented by your application:

 

abstract String columnLabel(int c);

 

abstract int getColumns ();

 

abstract String getFootnote();

 

abstract String getO1AxisTitle();

 

abstract String getO2AxisTitle();

 

abstract int getRows();

 

abstract String getSubtitle();

 

abstract String getTitle();

 

abstract Object getValue(int r,int c);

 

abstract String getX1AxisTitle(); .

 

abstract String getY1AxisTitle(); .

 

abstract String getY2AxisTitle();

 

abstract boolean isDirty();

 

abstract String rowLabel(int r);

 

TDGPreScaleIF is an optional callback interface that users with large datasets may implement in their existing data callbacks (TDGDataGrid) to expedite processing of data. See the TDGPreScaleIF interface below for details.

columnLabel()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e., setDataFromDataGrid()), this method must be implemented by your application in an object.This method is used to establish column labels/headings for the column specified by the input parameter c. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public String columnLabel(int c)

Input:

c; a column number

Return:

String; Column label at column c.

Example:

public String columnLabel(int c)
{
     return colLabels[c];
}

Also See:

setDataFromDataGrid()

getColumns()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e., setDataFromDataGrid()), this method must be implemented by your application in an object. This method is used to get the number of columns in the chart. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public int getColumns ();

Input:

void

Return:

int; The number of columns in the chart.

Example:

public int getColumns()
{
     return numCols;
}

Also See:

setDataFromDataGrid()

getFootnote()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e., setDataFromDataGrid()), this method must be implemented by your application in an object.This function is used to establish the chart footnote. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public String getFootnote();

Input:

void;

Return:

String; The chart footnote string.

Example:

public String getFootnote()
{
     return chartFootnote;
}

Also See:

setDataFromDataGrid()

getO1AxisTitle()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e., setDataFromDataGrid()), this method must be implemented by your application in an object.This function is used to establish the chart O1-axis title. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public String getO1AxisTitle();

Input:

void;

Return:

String; O1-Axis title string.

Example:

public String getO1AxisTitle()
{
     return chartO1AxisTitle;
}

Also See:

setDataFromDataGrid()

getO2AxisTitle()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e., setDataFromDataGrid()), this method must be implemented by your application in an object.This function is used to establish the chart O2-axis title. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public String getO2AxisTitle();

Input:

void;

Return:

String; O2-Axis title string.

Example:

public String getO2AxisTitle()
{
     return chartO2AxisTitle;
}

Also See:

setDataFromDataGrid()

getRows()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e.g, setDataFromDataGrid(), this method must be implemented by your application in an object.This method is used to get the number of rows in the chart. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public int getRows ();

Input:

void;

Return:

int; The number of rows in the chart.

Example:

public int getRows()
{
     return numRows;
}

Also See:

setDataFromDataGrid()

getSubtitle()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e., setDataFromDataGrid()), this method must be implemented by your application in an object. This function is used to establish the chart subtitle. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public String getSubtitle();

Input:

void;

Return:

String; Chart subtitle string.

Example:

public String getSubtitle()
{
     return chartSubTitle;
}

Also See:

setDataFromDataGrid()

getTitle()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e., setDataFromDataGrid()), this method must be implemented by your application in an object.This function is used to establish the chart title. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public String getTitle();

Input:

void;

Return:

String; Chart title string.

Example:

public String getTitle()
{
     return chartTitle;
}

Also See:

setDataFromDataGrid()

getValue()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e., setDataFromDataGrid()), this method must be implemented by your application in an object. This function gets the contents of the specified cell (at row (r), column (c)). Note that any type of Object can be returned. Perspective will interpret the Object type as a String or Double. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public Object getValue(int r, int c)

Input:

r; row number

Input:

c; column number

Return:

Object; Chart Data a row (r), column (c)

Example:

public Object getValue(int row, int col)
{
     return data[row][col];
}

Also See:

setDataFromDataGrid()

getX1AxisTitle()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e.g, setDataFromDataGrid(), this method must be implemented by your application in an object. This function is used to establish the chart X1-axis title. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public String getX1AxisTitle()

Input:

void;

Return:

String; The X1-Axis Title String

Example:

public String getX1AxisTitle()
{
     return chartX1AxisTitle;
}

Also See:

setDataFromDataGrid()

getY1AxisTitle()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e.g, setDataFromDataGrid(), this method must be implemented by your application in an object. This function is used to establish the chart Y1-axis title. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public String getY1AxisTitle()

Input:

void;

Return:

String; The Y1-Axis Title String

Example:

public String getY1AxisTitle()
{
     return chartY1AxisTitle;
}

Also See:

setDataFromDataGrid()

getY2AxisTitle()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e.g, setDataFromDataGrid(), this method must be implemented by your application in an object. This function is used to establish the chart Y2-axis title. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public String getY2AxisTitle()

Input:

void;

Return:

String; The Y2-Axis Title String

Example:

public String getY2AxisTitle()
{
     return chartY2AxisTitle;
}

Also See:

setDataFromDataGrid()

isDirty()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e.g, setDataFromDataGrid(), this method must be implemented by your application in an object. This function is used to determine if data in the chart has changed: TRUE = data has changed, FALSE = data has not changed. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public boolean isDirty();

Input:

void;

Return:

boolean; true/false

 

true=

Chart data has changed

 

false=

Chart data has not changed

Example:

public boolean isDirty()
{
     boolean tempDirty = isDirtyFlag;
     isDirtyFlag = false;
     return tempDirty;
}

Also See:

setDataFromDataGrid()

rowLabel()

This is a required method for the TDGDataGrid object. If you use TDGDataGrid (i.e.g, setDataFromDataGrid(), this method must be implemented by your application in an object.This method is used to establish row labels/headings for the row specified by the input parameter r. The syntax shows the format in which this method must be implemented by your application.

Syntax:

public String rowLabel(int r)

Input:

r; a row number

Return:

String; Row label at row r.

Example:

public String rowLabel(int r)
{
     return return rowLabels[r];
}

Also See:

setDataFromDataGrid()

TDGDataGridPieBar Interface

This interface defines a method to get the title string from a Pie-Bar chart.

getPieBarLabel()

 

This method establishes the chart title in a Pie-Bar chart.

Syntax:

java.lang.String getPieBarLabel()

Input:

void;

Return:

String; chart title

TDGListener Interface

The addPerspectiveListener() method creates an instance of an abstract class or interface to catch high-level events defined by the Perspective for Java integration. This method also tells the charting engine to notify the perspectiveEvent() method defined in the TDGListener interface when a Perspective event occurs.

perspectiveEvent()

The perspectiveEvent() method will be called with an event object when an Perspective event occurs. The perspectiveEvent() must be included and defined in the object identified by addPerspectiveListener(). The definition of the perspectiveEvent() method should indicate handling of events that are reported by the charting engine.

Syntax:

void perspectiveEvent ( TDGEvent e );

Input:

e: A location to store the event. On return, it will be set to the perspective event. Currently defined events include:

 

TDG_3DPRESET_CHANGED: 3D Preset Changed

 

TDG_APPLY_COLOR: Apply color change to current selection, if any.

 

TDG_CALC_PERFORMED: Calculation has been performed.

 

TDG_EDITOR_STATE_TOGGLE: Editing state has been toggled.

 

TDG_FIRST_EVENT_ID: Lowest event ID in Perspective JavaChart

 

TDG_GRAPHTYPE_CHANGED: GraphType was changed.

 

TDG_KEY_PRESSED: Key was pressed.

 

TDG_KEY_RELEASED: Key was release.

 

TDG_KEY_TYPED: Key was typed.

 

TDG_LAST_EVENT_ID: Highest event ID in Perspective JavaChart

 

TDG_MOUSE_CLICKED: Mouse click event.

 

TDG_MOUSE_DRAGGED: Mouse drag event.

 

TDG_MOUSE_ENTERED: Mouse entered.

 

TDG_MOUSE_EXITED: Mouse exited.

 

TDG_MOUSE_MOVED: Mouse move.

 

TDG_MOUSE_PRESSED: Mouse button pressed.

 

TDG_MOUSE_RELEASED: Mouse button released.

 

TDG_NOT_ENOUGH_DATA: Not enough data to draw the chart

 

TDG_RESIZE_HANDLE_CHANGED: Mouse is over a resize handle.

 

TDG_SELECTION_CHANGE: Perspective selection changes

Return:

void;

Example:

See FullMetalListener() in Appendix G

Also See:

addPerspectiveListener()

TDGNestedLabel Interface

 

The TDGNestedLabel Interface defines the following methods:

 

java.util.Vector getAllLabels(int nLevel);

 

java.lang.String getLabel(int nGroup, int nLevel);

 

int getLabelGrouping(int nGroup, int nLevel);

 

int getNumLabelsOnLevel(int nLevel);

 

int getNumLevels();

 

Perspective supports nested/multi-dimensional labels on the O1 axis with these properties and methods:

 

setO1LabelCallback(): This method assigns a callback function to the nested labels interface.

 

getO1LabelCallback(): This method determines if a callback function has been assigned with setO1LabelCallback().

 

NestedLabels (true/false): This property enables/disables nested labels.

 

Use the following procedures to implement the nested labels interface:

 

1.

You must create your own version of the nested labels callback. It must implement all of the abstract methods defined in the TDGNestedLabel interface.

 

2.

Register the callback with the setO1LabelCallback() method.

Example:

 

m_chart.setO1LabelCallback (TDGNestedLabel cb);

 

3.

Enable the NestedLabel property.

Example:

 

m_chart.setNestedLabels (true);

 

Perspective includes a simple example of nested labels in the TDGTestNestedGroupsLabels class. The example class can be enabled by setting the NestedLabels properrty to true.

getAllLabels

 

This method gets all the labels at the specified level (for batch autofitting).

Syntax:

java.util.Vector getAllLabels(int nLevel);

Input:

nLevel; Level to get the labels from.

Return:

Vector; Vector of String objects.

getLabel

 

This method gets the string specified by the group and level. If nLevel is zero, the group label is returned. If nLevel is 1, its immediate parent in the hierarchy, etc. is returned.

Syntax:

java.lang.String getLabel(int nGroup, int nLevel);

Input:

nGroup; a group number.

 

nLevel; a multi-dimensional label level

Return:

String; the label at nGroup, nLevel

   

getLabelGrouping

 

This method gets the number of labels grouped at the level specified by the group and level.

Syntax:

int getLabelGrouping(int nGroup, int nLevel);

Input:

nGroup; a group number.

 

nLevel; a multi-dimensional label level

Return:

int; Number of labels grouped at nGroup, nLevel

   

getNumLabelsOnLevel

 

This method returns an integer value that identifies how many labels there are on a given level.

Syntax:

int getNumLabelsOnLevel(int nLevel);

Input:

nLevel; a multi-dimensional label level

Return:

int; Number of labels on nLevel

   

getNumLevels

 

This method returns an integer value that defines the number nested-label levels.

Syntax:

int getNumLevels();

Input:

None

Return:

int; Number of nested label levels.

   

TDGPreScaleIF Interface

 

TDGPreScaleIF is an optional callback interface that users with large datasets may implement in their existing data callbacks (TDGDataGrid) to expedite processing of data. There are 2 methods in the interface:

 

public double getScaleMinimum(int nAxis, int scaling) throws Exception

 

public double getScaleMaximum(int nAxis, int scaling) throws Exception

 

The following code shows an example implementation of this interface.

Example:

package tdg;
import tdg.data.in.TDGDataGrid;
import tdg.data.in.TDGPreScaleIF;
import java.util.Random;
public class LargeDefaultData implements TDGDataGrid,
    TDGPreScaleIF
{
    static final int SMALL_DATASET = 10;
    static final int LARGE_DATASET = 1000;
    boolean isDirtyFlag = false;
    double[][] testdata = new double[LARGE_DATASET]
    [SMALL_DATASET];
    Object data[][];
    String[] rowLabels = new String[LARGE_DATASET];
    String[] colLabels = {"1", "2", "3", "4", "5", "6", 
        "7","8", "9", "10"};
    int numCols = SMALL_DATASET;
    int numRows = LARGE_DATASET;
    double value;
    double min = Double.MAX_VALUE;
    double max = -Double.MAX_VALUE;
    Random randNum = new Random(1000);
    public LargeDefaultData()
    {
        // Row Labels.
        for(int i=0; i<numRows; i++)
            rowLabels[i] = "" + (i+1);
        // Load Data.
        data = new Object[numRows][numCols];
        for(int row = 0; row < numRows; row++)
        {
            for(int col = 0; col < numCols; col++)
            {
                value = randNum.nextDouble() * 100;
                data[row][col] = new Double(value);
                // For dataformats with more than one 
                // numeric axis, e.g. scatter, we
                // need to check which axis "value" 
                // was associated with.
                if (value < min)min = value;
                if (value > max)max = value;
            }
        }
    }
    public String getTitle() { 
        return "Performance Test Title"; }
    public String getSubtitle() { return ""; }
    public String getFootnote() { return ""; }
    public String getX1AxisTitle() { return ""; }
    public String getY1AxisTitle() { return ""; }
    public String getO1AxisTitle() { return ""; }
    public String getO2AxisTitle() { return ""; }
    public String getY2AxisTitle() { return ""; }
    public String columnLabel(int x) { 
        return colLabels[x]; }

 

    public int getColumns() { return numCols; }
    public String rowLabel(int x) {return rowLabels[x];}
    public int getRows() { return numRows; }
    public Object getValue(int row, int col) { 
            return data[row][col]; }
    public boolean isDirty() { return isDirtyFlag; }

 

    // Needed for TDGPreScaleIF interface to speed PFJ 
    // scale calculations
    public double getScaleMinimum(int nAxis, 
        int nScaling)throws Exception
    {
        // Stacked,Percent,Histogram scaling too complex,
        // let PFJ do it!
        if (nScaling == TDGPreScaleIF.SCALING_ABSOLUTE)
            return min;
        else
            throw new Exception(
                "Sorry, I don't understand 
                    this scaling: " + nScaling);
    }

 

    public double getScaleMaximum(int nAxis, 
        int nScaling) throws Exception
    {
        // Stacked,Percent,Histogram scaling too , 
        // complex let PFJ do it!
        if (nScaling == TDGPreScaleIF.SCALING_ABSOLUTE)
            return max;
        else
            throw new Exception("Sorry, I don't 
                understand this scaling: " + nScaling);
    }
}

   

getScaleMaximum()

Based on the axis and scaling parameters, you may decide at runtime NOT to handle this call and choose to throw an Exception. If the call to the callback method results in an exception, Perspective for Java will catch the exception and do the scaling.

Syntax:

public double getScaleMaximum(
     int nAxis,
     int scaling
) throws Exception

Input:

nAxis; an integer that identifies an axis

scaling; an integer that identifies the type of scaling

 

SCALING_ABSOLUTE

 

SCALING_STACKED

 

SCALING_PERCENT

 

SCALING_HIST

Return:

double; maximum value to calculate scaling

Example:

public double getScaleMaximum(int nAxis, 
    int nScaling) throws Exception
{
    // Stacked,Percent,Histogram scaling too , 
    // complex let PFJ do it!
    if (nScaling == TDGPreScaleIF.SCALING_ABSOLUTE)
        return max;
    else
       throw new Exception("Sorry, I don't 
            understand this scaling: " + nScaling);
    }

Also See:

getScaleMinimum()

getScaleMinimum()

Based on the axis and scaling parameters, you may decide at runtime NOT to handle this call and choose to throw an Exception. If the call to the callback method results in an exception, Perspective for Java will catch the exception and do the scaling.

Syntax:

public double getScaleMinimum(
     int nAxis,
     int scaling
) throws Exception

input:

nAxis; an integer that identifies an axis

scaling; an integer that identifies the type of scaling

 

SCALING_ABSOLUTE

 

SCALING_STACKED

 

SCALING_PERCENT

 

SCALING_HIST

Return:

double; minimum value to calculate scaling

Example:

public double getScaleMinimum(int nAxis, 
    int nScaling)throws Exception
{
    // Stacked,Percent,Histogram scaling too complex,
    // let PFJ do it!
    if (nScaling == TDGPreScaleIF.SCALING_ABSOLUTE)
        return min;
    else
        throw new Exception(
            "Sorry, I don't understand 
               this scaling: " + nScaling);
    }

Also See:

getScaleMaximum()

   

ToolTipCallback Interface

This interface defines a dynamic callback function to produce a tooltip:

getDynamicToolTip()

 

This function is a dynamic callback to produce a tooltip. When this method is called, your application should provide a very fast method that returns the proper string for the object in question.

Syntax:

String getDynamicToolTip(
    tdg.TDGMouseState aMouseState,
    boolean UserOrDeveloper
)

Input:

aMouseState; an object of class TDGMouseState which provides all the information about the object for which the tooltip is being generated.

 

UserOrDeveloper; true/false

 

true=

Developer information

 

false=

User information

Return:

String; tooltip result string.

Notes:

getDynamicToolTip() is defined in the ToolTipCallBack interface.

Example:

public class TestToolTipCallBack
implements
ToolTipCallBack
{
    public String getDynamicToolTip(
        TDGMouseState aMouseState,
        boolean UserOrDeveloper )
{
    String strReturn;
    // MACROS that are expanded in a CUSTOM Tool Tip
    // Examples:
    // [ON] is ([OID])[R]Instance # [OIN][R]
    //
/*
    // MACROS for formatting
    static final String RETURN_MACRO = "[R]";// A CR
    // MACROS for OBJECTS and OBJECT IDS
    static final String OBJECT_NAME_MACRO = "[ON]";
    static final String OBJECT_DESCRIPTION_MACRO = "[OD]";
    static final String OBJECT_ID_MACRO = "[OID]";
    static final String OBJECT_INSTANCE_MACRO = "[OIN]";
    static final String SERIES_LABEL_MACRO = "[SL]";
    static final String GROUP_LABEL_MACRO = "[GL]";
    // MACROS for VALUES
    static final String 
        CUMULATIVE_STACKED_VALUE_MACRO = "[CUMSTKV]";
    static final String 
        CUMULATIVE_PERCENTAGE_VALUE_MACRO = "[CUMPCTV]";
    static final String 
        PIE_PERCENTAGE_VALUE_MACRO = "[PIEPCTV]";
    static final String HILO_HIGH_VALUE_MACRO = "[HV]";
    static final String HILO_LOW_VALUE_MACRO = "[LV]";
    static final String HILO_OPEN_VALUE_MACRO = "[OV]";
    static final String HILO_CLOSE_VALUE_MACRO = "[CV]";
    static final String HILO_VOLUME_VALUE_MACRO = "[VV]";
    static final String X_VALUE_MACRO = "[XV]";
    static final String Y_VALUE_MACRO = "[YV]";
    static final String Z_VALUE_MACRO = "[ZV]";
*/
    strReturn = "Element ID is (" +
        aMouseState.getElementObjectID() + ")[R]";
    strReturn += "Series = [SL][R]";
    strReturn += "Group = [GL][R]";
    strReturn += "Cumulative Stacked = [CUMSTKV][R]";
    strReturn += "Cumulative Percentage = [CUMPCTV][R]";
    strReturn += "Pie Percentage = [PIEPCTV][R]";
    strReturn += "High = [HV][R]";
    strReturn += "Low = [LV][R]";
    strReturn += "Open = [OV][R]";
    strReturn += "Close = [CV][R]";
    strReturn += "Volume = [VV][R]";
    strReturn += "X Value = [XV][R]";
    strReturn += "Y Value = [YV][R]";
    strReturn += "Z Value = [ZV][R]";
    return strReturn;
    }        
}

Also See:

setDynamicToolTip()