Package org.eclipse.birt.chart.computation

# Class BIRTChartComputation

java.lang.Object
org.eclipse.birt.chart.computation.BIRTChartComputation

All Implemented Interfaces:
  `IChartComputation`

public class BIRTChartComputation extends Object implements IChartComputation

## Constructor Summary

Constructors
Constructor
Description
`BIRTChartComputation()`

## Method Summary

Modifier and Type
Method
Description
`void`
`applyWrapping(IDisplayServer xs, Label la, double dWrapping)`
Apply the wrapping to a label.
`BoundingBox`
`computeBox(IDisplayServer xs, int iLabelLocation, Label la, double dX, double dY)`
Compute the bounding box ( location and size ) of a label.
`double`
`computeFontHeight(IDisplayServer xs, Label la)`
Convenient method to compute the font's height of a label.
`double`
`computeHeight(IDisplayServer xs, Label la)`
Compute the height of a label.
`BoundingBox`
`computeLabelSize(IDisplayServer xs, Label la, double dWrapping, Double fontHeight)`
Compute the size of a label.
`RotatedRectangle`
`computePolygon(IDisplayServer xs, int iLabelLocation, Label la, double dX, double dY, Double fontHeight)`
Compute the bounding polygon of a label.
`double`
`computeWidth(IDisplayServer xs, Label la)`
Compute the width of a label.
`void`
`dispose()`
`ITextMetrics`
`getTextMetrics(IDisplayServer xs, Label la, double wrapping)`
Returns a text metrics.
`void`
`recycleTextMetrics(ITextMetrics itm)`
Dispose the text metrics.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### BIRTChartComputation

public BIRTChartComputation()

## Method Details

### computeFontHeight

public double computeFontHeight(IDisplayServer xs, Label la) throws ChartException
Description copied from interface: `IChartComputation`
Convenient method to compute the font's height of a label. This computation is costly, but in most case we do not change the font of a label, we just change the string value, so the font height will not changed. The purpose of the method is to get the font height overhead for reusing.

Specified by:
  `computeFontHeight` in interface `IChartComputation`
Parameters:
  `xs` -
  `la` -
Returns:
  font height
Throws:
  `ChartException`

### getTextMetrics

public ITextMetrics getTextMetrics(IDisplayServer xs, Label la, double wrapping)
Description copied from interface: `IChartComputation`
Returns a text metrics.

Specified by:
  `getTextMetrics` in interface `IChartComputation`
Parameters:
  `xs` -
  `la` -
  `wrapping` -
Returns:

### computeLabelSize

public BoundingBox computeLabelSize(IDisplayServer xs, Label la, double dWrapping, Double fontHeight) throws ChartException
Description copied from interface: `IChartComputation`
Compute the size of a label.

Specified by:
  `computeLabelSize` in interface `IChartComputation`
Parameters:
  `xs` -
  `la` -
  `dWrapping` -
  `fontHeight` -
Returns:
Throws:
  `ChartException`

### computeBox

public BoundingBox computeBox(IDisplayServer xs, int iLabelLocation, Label la, double dX, double dY) throws ChartException
Description copied from interface: `IChartComputation`
Compute the bounding box ( location and size ) of a label.

Specified by:
  `computeBox` in interface `IChartComputation`
Parameters:
  `xs` -
  `iLabelLocation` -
  `la` -
  `dX` -
  `dY` -
Returns:
Throws:
  `ChartException`

### computePolygon

public RotatedRectangle computePolygon(IDisplayServer xs, int iLabelLocation, Label la, double dX, double dY, Double fontHeight) throws ChartException
Description copied from interface: `IChartComputation`
Compute the bounding polygon of a label.

Specified by:
  `computePolygon` in interface `IChartComputation`
Parameters:
  `xs` -
  `iLabelLocation` -
  `la` -
  `dX` -
  `dY` -
  `fontHeight` -
Returns:
Throws:
  `ChartException`

### computeWidth

public double computeWidth(IDisplayServer xs, Label la) throws ChartException
Description copied from interface: `IChartComputation`
Compute the width of a label.

Specified by:
  `computeWidth` in interface `IChartComputation`
Parameters:
  `xs` -
  `la` -
Returns:
Throws:
  `ChartException`

### computeHeight

public double computeHeight(IDisplayServer xs, Label la) throws ChartException
Description copied from interface: `IChartComputation`
Compute the height of a label.

Specified by:
  `computeHeight` in interface `IChartComputation`
Parameters:
  `xs` -
  `la` -
Returns:
Throws:
  `ChartException`

### dispose

public void dispose()

Specified by:
  `dispose` in interface `IChartComputation`

### applyWrapping

public void applyWrapping(IDisplayServer xs, Label la, double dWrapping) throws ChartException
Description copied from interface: `IChartComputation`
Apply the wrapping to a label.

Specified by:
  `applyWrapping` in interface `IChartComputation`
Parameters:
  `xs` -
  `la` -
  `dWrapping` -
Throws:
  `ChartException`

### recycleTextMetrics

public void recycleTextMetrics(ITextMetrics itm)
Description copied from interface: `IChartComputation`
Dispose the text metrics.

Specified by:
  `recycleTextMetrics` in interface `IChartComputation`
Parameters:
  `itm` -