jACOB 2.7 API Documentation.

de.tif.jacob.screen.event
Class IChartEventHandler

java.lang.Object
  extended by EventHandler
      extended by de.tif.jacob.screen.event.GuiEventHandler
          extended by de.tif.jacob.screen.event.IGroupMemberEventHandler
              extended by de.tif.jacob.screen.event.IChartEventHandler
Direct Known Subclasses:
IBarChartEventHandler, ILineChartEventHandler

public abstract class IChartEventHandler
extends IGroupMemberEventHandler

Abstract event handler class for charts. Derived implementations of this event handler class have to be used to "hook" application-specific business logic to charts.


Field Summary
static java.lang.String RCS_ID
          The internal revision control system id.
static java.lang.String RCS_REV
          The internal revision control system id in short form.
 
Constructor Summary
IChartEventHandler()
           
 
Method Summary
abstract  java.awt.Color[] getColors(IClientContext context, IChart chart)
          Returns the different colors for the chart lines and chart bars.
abstract  double[][] getDataElements(IClientContext context, IChart chart)
          Returns an array of data values.
abstract  java.lang.String[] getLegendLabels(IClientContext context, IChart chart)
          Returns the legend labels for the chart.
abstract  java.lang.String getTitle(IClientContext context, IChart chart)
          Returns the title of the chart.
abstract  java.lang.String[] getXAxisLabels(IClientContext context, IChart chart)
          Returns the labels for the x-axis.
abstract  java.lang.String getXAxisTitle(IClientContext context, IChart chart)
          Returns the caption of the x-axis.
abstract  java.lang.String getYAxisTitle(IClientContext context, IChart chart)
          Returns the caption of the y-axis.
 
Methods inherited from class de.tif.jacob.screen.event.IGroupMemberEventHandler
onGroupStatusChanged, onHide, onShow
 
Methods inherited from class de.tif.jacob.screen.event.GuiEventHandler
alert, alert, alert
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RCS_ID

public static final transient java.lang.String RCS_ID
The internal revision control system id.

See Also:
Constant Field Values

RCS_REV

public static final transient java.lang.String RCS_REV
The internal revision control system id in short form.

See Also:
Constant Field Values
Constructor Detail

IChartEventHandler

public IChartEventHandler()
Method Detail

getTitle

public abstract java.lang.String getTitle(IClientContext context,
                                          IChart chart)
                                   throws java.lang.Exception
Returns the title of the chart.

Example:

 public String getTitle(IClientContext context, IChart chart)
 {
   return ApplicationMessage.getLocalized("MyChart.Title");
 }
 

Parameters:
context - the current client context
chart - the chart itself
Returns:
The title of the chart
Throws:
java.lang.Exception

getXAxisTitle

public abstract java.lang.String getXAxisTitle(IClientContext context,
                                               IChart chart)
                                        throws java.lang.Exception
Returns the caption of the x-axis.

Parameters:
context - the current client context
chart - the chart itself
Returns:
The caption of the x-axis
Throws:
java.lang.Exception

getYAxisTitle

public abstract java.lang.String getYAxisTitle(IClientContext context,
                                               IChart chart)
                                        throws java.lang.Exception
Returns the caption of the y-axis.

Parameters:
context - the current client context
chart - the chart itself
Returns:
The caption of the y-axis
Throws:
java.lang.Exception

getXAxisLabels

public abstract java.lang.String[] getXAxisLabels(IClientContext context,
                                                  IChart chart)
                                           throws java.lang.Exception
Returns the labels for the x-axis.

The dimension of the array returned must as follows: String [numberOfValues]

Parameters:
context - the current client context
chart - the chart itself
Returns:
the labels for the x-axis
Throws:
java.lang.Exception

getLegendLabels

public abstract java.lang.String[] getLegendLabels(IClientContext context,
                                                   IChart chart)
                                            throws java.lang.Exception
Returns the legend labels for the chart.

For line charts the dimension of the array returned must as follows: String [numberOfLines]
Thereas, for bar charts as follows: String [1]

Parameters:
context - the current client context
chart - the chart itself
Returns:
the legend label array
Throws:
java.lang.Exception

getColors

public abstract java.awt.Color[] getColors(IClientContext context,
                                           IChart chart)
                                    throws java.lang.Exception
Returns the different colors for the chart lines and chart bars.

For line charts the dimension of the array returned must as follows: Color [numberOfLines]
Thereas, for bar charts as follows: Color [1]

Parameters:
context - the current client context
chart - the chart itself
Returns:
the color array
Throws:
java.lang.Exception

getDataElements

public abstract double[][] getDataElements(IClientContext context,
                                           IChart chart)
                                    throws java.lang.Exception
Returns an array of data values.

For line charts the dimension of the array returned must as follows: double [numberOfLines][numberOfValues]
Thereas, for bar charts as follows: double [1][numberOfValues]
Example:

 double[][] data = new double[1][numberOfValues];
 for (int j = 0; j < numberOfValues; j++)
 {
   data[0][j] = getRandomNumber(minValue, maxValue);
 }
 return data;
 

Parameters:
context - the current client context
chart - the chart itself
Returns:
the data values array
Throws:
java.lang.Exception

jACOB 2.7 API Documentation.