JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Interface JCChartLabelManager

All Known Implementing Classes:
JCDefaultChartLabelManager

public interface JCChartLabelManager

An interface to be used by any class wanting to implement chart label functionality within JClass Chart.


Method Summary
 void addAutoLabels(com.klg.jclass.chart.ChartDataView cdv, int addSeries, int addPoint)
          Adds some automatically created JCChartLabels.
 void addChartLabel(com.klg.jclass.chart.JCChartLabel label)
          Adds a chart label, forcing a recalculation of it and a redraw of the parent chart.
 void addToDwellLabels(com.klg.jclass.chart.JCChartLabel label)
          Adds a new chart label to the list of dwell labels.
 void clearAutoLabels(com.klg.jclass.chart.ChartDataView cdv)
          Clears the auto labels list for this data view.
 String createAutoLabelText(com.klg.jclass.chart.ChartDataView cdv, int series, int point)
          Creates the text for an auto label given the series and point.
 void generateAutoLabels(com.klg.jclass.chart.ChartDataView cdv)
          Automatically creates JCChartLabels for every series and point, if requested.
 com.klg.jclass.chart.JCChartLabel[][] getAutoLabelList(com.klg.jclass.chart.ChartDataView cdv)
          Gets the AutoLabelList property for the ChartDataView object.
 List getChartLabels()
          Gets the value of the ChartLabels indexed property.
 com.klg.jclass.chart.JCChartLabel getChartLabels(int index)
          Gets a value of the ChartLabels indexed property.
 com.klg.jclass.chart.JCChartLabel getCurrentDwellLabel()
          Gets the current dwell label.
 Point getCurrentDwellLabelAttachPoint()
          Gets the AttachPoint property of the current dwell label, if one exists.
 JComponent getCurrentDwellLabelComponent()
          Gets the Component property of the current dwell label.
 int getNumChartLabels()
          Gets the current number of chart labels.
 com.klg.jclass.chart.JCChart getParentChart()
          Gets the chart for which this class is managing chart labels.
 boolean locateCurrentDwellLabel(int x, int y)
          Locates the dwell label that is associated with the given coordinates and marks it as the current dwell label.
 void markAllChartLabelsForRecalc()
          Marks all chart labels for later recalculation.
 void paintConnectors(Graphics gc)
          Paints the connectors between the chart labels and the points to which they are connected.
 void recalcChangedChartLabels()
          Forces recalculation of any chart labels marked for a recalc.
 void removeAllChartLabels()
          Removes all of the chart labels.
 void removeAutoLabels(com.klg.jclass.chart.ChartDataView cdv)
          Removes all of the automatically created JCChartLabels.
 void removeAutoLabels(com.klg.jclass.chart.ChartDataView cdv, int remSeries, int remPoint)
          Removes some of the automatically created JCChartLabels.
 void removeChartLabel(com.klg.jclass.chart.JCChartLabel label)
          Removes a chart label, forcing a redraw of the parent chart.
 void removeFromDwellLabels(com.klg.jclass.chart.JCChartLabel label)
          Removes a chart label from the list of dwell labels.
 void setAutoLabelText(com.klg.jclass.chart.ChartDataView cdv, int series, int point)
          Sets the text on an auto label given the series and point.
 void setChartLabels(int index, com.klg.jclass.chart.JCChartLabel lbl)
          Sets a value of the ChartLabels indexed property.
 void setChartLabels(List s)
          Sets the value of the ChartLabels indexed property.
 void setParentChart(com.klg.jclass.chart.JCChart chart)
          Sets the chart for which this class is managing chart labels.
 void updateParent(int cf)
          Updates the parent chart based on the type of change made to the child chart label.
 

Method Detail

setParentChart

public void setParentChart(com.klg.jclass.chart.JCChart chart)
Sets the chart for which this class is managing chart labels.

Parameters:
chart - parent JCChart instance

getParentChart

public com.klg.jclass.chart.JCChart getParentChart()
Gets the chart for which this class is managing chart labels.

Returns:
parent JCChart instance

paintConnectors

public void paintConnectors(Graphics gc)
Paints the connectors between the chart labels and the points to which they are connected.

Parameters:
gc - Graphics object of parent chart used for painting connectors

addChartLabel

public void addChartLabel(com.klg.jclass.chart.JCChartLabel label)
Adds a chart label, forcing a recalculation of it and a redraw of the parent chart.

Parameters:
label - the JCChartLabel instance to add

addToDwellLabels

public void addToDwellLabels(com.klg.jclass.chart.JCChartLabel label)
Adds a new chart label to the list of dwell labels.

Parameters:
label - the JCChartLabel instance being added to the dwell label list

locateCurrentDwellLabel

public boolean locateCurrentDwellLabel(int x,
                                       int y)
Locates the dwell label that is associated with the given coordinates and marks it as the current dwell label.

Parameters:
x - the x coordinate within the JCChartArea
y - the y coordinate within the JCChartArea
Returns:
true if dwell label is found; false otherwise

getCurrentDwellLabelAttachPoint

public Point getCurrentDwellLabelAttachPoint()
Gets the AttachPoint property of the current dwell label, if one exists.

Returns:
the AttachPoint property of the current dwell label, an instance of the Point object, or null

getCurrentDwellLabelComponent

public JComponent getCurrentDwellLabelComponent()
Gets the Component property of the current dwell label.

Returns:
the component part of the current dwell label, an instance of the JComponent class, or null

getCurrentDwellLabel

public com.klg.jclass.chart.JCChartLabel getCurrentDwellLabel()
Gets the current dwell label.

Returns:
the current dwell label, an instance of the JChartLabel class, or null

removeChartLabel

public void removeChartLabel(com.klg.jclass.chart.JCChartLabel label)
Removes a chart label, forcing a redraw of the parent chart.

Parameters:
label - the JCChartLabel instance to remove from the chart label list

removeFromDwellLabels

public void removeFromDwellLabels(com.klg.jclass.chart.JCChartLabel label)
Removes a chart label from the list of dwell labels.

Parameters:
label - the JCChartLabel instance to remove from the dwell label list

getNumChartLabels

public int getNumChartLabels()
Gets the current number of chart labels.

Returns:
the number of chart labels this manager holds

removeAllChartLabels

public void removeAllChartLabels()
Removes all of the chart labels. If the AutoLabel property has been set on any of this chart's DataViews, the property should be set to false and the list of auto labels nulled out.


getChartLabels

public com.klg.jclass.chart.JCChartLabel getChartLabels(int index)
Gets a value of the ChartLabels indexed property. The ChartLabels property controls a list of chart labels managed by the chart.

Parameters:
index - position at which to add the new object
Returns:
requested chart label

setChartLabels

public void setChartLabels(int index,
                           com.klg.jclass.chart.JCChartLabel lbl)
Sets a value of the ChartLabels indexed property. The ChartLabels property controls a list of chart labels managed by the chart.

Parameters:
index - position at which to add the new object; to add a new item at the end, set the position to the current size of the labels array
lbl - new chart label to be added
Throws:
IllegalArgumentException - Thrown if the index is larger than the size of the array.

getChartLabels

public List getChartLabels()
Gets the value of the ChartLabels indexed property. The ChartLabels property controls a list of chart labels managed by the chart.

Returns:
List object containing all the chart labels for this JCChart

setChartLabels

public void setChartLabels(List s)
Sets the value of the ChartLabels indexed property. The ChartLabels property controls a list of chart labels managed by the chart.

Parameters:
s - List object containg chart labels to add to this JCChart

markAllChartLabelsForRecalc

public void markAllChartLabelsForRecalc()
Marks all chart labels for later recalculation.


recalcChangedChartLabels

public void recalcChangedChartLabels()
Forces recalculation of any chart labels marked for a recalc. This is necessary when chart label property changes force a chart layout.


getAutoLabelList

public com.klg.jclass.chart.JCChartLabel[][] getAutoLabelList(com.klg.jclass.chart.ChartDataView cdv)
Gets the AutoLabelList property for the ChartDataView object. The AutoLabelList property is a two-dimensional array of automatically generated JCChartLabel instances, one for every point and series. The inner array is indexed by point; the outer array by series.

Parameters:
cdv - the ChartDataView instance that defines the auto label list
Returns:
array of JCChartLabel objects representing the automatically generated chart labels

generateAutoLabels

public void generateAutoLabels(com.klg.jclass.chart.ChartDataView cdv)
Automatically creates JCChartLabels for every series and point, if requested.

Parameters:
cdv - the ChartDataView instance that defines the auto label list

createAutoLabelText

public String createAutoLabelText(com.klg.jclass.chart.ChartDataView cdv,
                                  int series,
                                  int point)
Creates the text for an auto label given the series and point.

Parameters:
cdv - the ChartDataView instance that defines the auto label list
series - the series number
point - the point number within the series
Returns:
the newly created text

setAutoLabelText

public void setAutoLabelText(com.klg.jclass.chart.ChartDataView cdv,
                             int series,
                             int point)
Sets the text on an auto label given the series and point.

Parameters:
cdv - the ChartDataView instance that defines the auto label list
series - the series number
point - the point number within the series

addAutoLabels

public void addAutoLabels(com.klg.jclass.chart.ChartDataView cdv,
                          int addSeries,
                          int addPoint)
Adds some automatically created JCChartLabels.

Parameters:
cdv - the ChartDataView instance that defines the auto label list
addSeries - the series number to add auto labels for (if -1, add applies to all series)
addPoint - the point number within a series to add auto labels for (if -1, add applies to all points within the given series)

removeAutoLabels

public void removeAutoLabels(com.klg.jclass.chart.ChartDataView cdv,
                             int remSeries,
                             int remPoint)
Removes some of the automatically created JCChartLabels.

Parameters:
cdv - the ChartDataView instance that defines the auto label list
remSeries - the series number to remove auto labels for (if -1, remove applies to all series)
remPoint - the point number within a series to remove auto labels for (if -1, remove applies to all points within the given series)

removeAutoLabels

public void removeAutoLabels(com.klg.jclass.chart.ChartDataView cdv)
Removes all of the automatically created JCChartLabels.

Parameters:
cdv - the ChartDataView instance that defines the auto label list

clearAutoLabels

public void clearAutoLabels(com.klg.jclass.chart.ChartDataView cdv)
Clears the auto labels list for this data view. Simply removes the lists' references internally. Does nothing to remove the labels from the chart.

Parameters:
cdv - ChartDataView instance from which the auto labels are to be cleared

updateParent

public void updateParent(int cf)
Updates the parent chart based on the type of change made to the child chart label.

Parameters:
cf - the changed flag

Copyright © 2004 Quest Software Inc..
All rights reserved.