Package org.eclipse.birt.chart.event

# Class TextRenderEvent

java.lang.Object
java.util.EventObject
org.eclipse.birt.chart.event.ChartEvent
org.eclipse.birt.chart.event.PrimitiveRenderEvent
org.eclipse.birt.chart.event.TextRenderEvent

All Implemented Interfaces:
  `Serializable`, `Comparable`

Direct Known Subclasses:
  `Text3DRenderEvent`

public class TextRenderEvent extends PrimitiveRenderEvent
A rendering event type for rendering text object.

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ABOVE`
A constant used with the 'TextPosition' attribute.
`static final int`
`BELOW`
A constant used with the 'TextPosition' attribute.
`static final int`
`LEFT`
A constant used with the 'TextPosition' attribute.
`static final int`
`RENDER_SHADOW_AT_LOCATION`
Renders a shadow offset with the encapsulating container rectangle's corner or edge aligned with a given point This action requires Label, Location, TextPosition to be set
`static final int`
`RENDER_TEXT_AT_LOCATION`
Renders text (with optional insets, border, fill, etc) with the encapsulating container rectangle's corner or edge aligning with a given point This action requires Label, Location, TextPosition to be set
`static final int`
`RENDER_TEXT_IN_BLOCK`
Renders text (with optional insets, border, fill, etc) with the encapsulating container rectangle's bounding box aligned with a parent block's bounds This action requires Label, BlockBounds, BlockAlignment to be set
`static final int`
`RIGHT`
A constant used with the 'TextPosition' attribute.
`static final int`
`UNDEFINED`
An undefined action that will result in an error

### Fields inherited from class org.eclipse.birt.chart.event.PrimitiveRenderEvent

`DRAW, FILL, iObjIndex`

## Constructor Summary

Constructors
Constructor
Description
`TextRenderEvent(Object oSource)`
The constructor.

## Method Summary

Modifier and Type
Method
Description
`PrimitiveRenderEvent`
`copy()`
`final void`
`draw(IDeviceRenderer idr)`
Causes this instruction to 'draw' itself on the device renderer
`void`
`fill(IDeviceRenderer idr)`
Causes this instruction to 'fill' itself on the device renderer
`final int`
`getAction()`
`final TextAlignment`
`getBlockAlignment()`
`final Bounds`
`getBlockBounds()`
`final Label`
`getLabel()`
`final Location`
`getLocation()`
`final int`
`getTextPosition()`
`void`
`reset()`
Resets the inner state of current event.
`final void`
`setAction(int iAction)`
Sets the action of current event.
`final void`
`setBlockAlignment(TextAlignment taBlock)`
Sets the block alignment of the text.
`final void`
`setBlockBounds(Bounds boBlock)`
Sets the block bounds of the text.
`final void`
`setLabel(Label la)`
Sets the label of the text.
`final void`
`setLocation(Location lo)`
Sets the location of the text.
`final void`
`setRtlCaption()`
Adds the "RLE" and "PDF" unicode control characters to label caption where "RLE" is added to the beginning and "PDF" to the end to apply right to left reading order
`final void`
`setTextPosition(int iTextPosition)`
Sets the position of the text.
`final void`
`updateFrom(LabelBlock lb, double dScale, RunTimeContext rtc)`
Updates the event by given LabelBlock object.

### Methods inherited from class org.eclipse.birt.chart.event.PrimitiveRenderEvent

`compareRegular, compareTo, compareTransposed, getBackground, getBounds, getDepth, getLineAttributes, isEnabled, setDepth, setEnable`

### Methods inherited from class org.eclipse.birt.chart.event.ChartEvent

`setSourceObject`

### Methods inherited from class java.util.EventObject

`getSource, toString`

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

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

## Field Details

### UNDEFINED

public static final int UNDEFINED
An undefined action that will result in an error

See Also:
  - Constant Field Values

### RENDER_SHADOW_AT_LOCATION

public static final int RENDER_SHADOW_AT_LOCATION
Renders a shadow offset with the encapsulating container rectangle's corner or edge aligned with a given point This action requires Label, Location, TextPosition to be set

See Also:
  - Constant Field Values

### RENDER_TEXT_AT_LOCATION

public static final int RENDER_TEXT_AT_LOCATION
Renders text (with optional insets, border, fill, etc) with the encapsulating container rectangle's corner or edge aligning with a given point This action requires Label, Location, TextPosition to be set

See Also:
  - Constant Field Values

### RENDER_TEXT_IN_BLOCK

public static final int RENDER_TEXT_IN_BLOCK
Renders text (with optional insets, border, fill, etc) with the encapsulating container rectangle's bounding box aligned with a parent block's bounds This action requires Label, BlockBounds, BlockAlignment to be set

See Also:
  - Constant Field Values

### LEFT

public static final int LEFT
A constant used with the 'TextPosition' attribute. This indicates that the text is positioned to the left of the reference point 'Location'

See Also:
  - Constant Field Values

### RIGHT

public static final int RIGHT
A constant used with the 'TextPosition' attribute. This indicates that the text is positioned to the right of the reference point 'Location'

See Also:
  - Constant Field Values

### ABOVE

public static final int ABOVE
A constant used with the 'TextPosition' attribute. This indicates that the text is positioned above the reference point 'Location'

See Also:
  - Constant Field Values

### BELOW

public static final int BELOW
A constant used with the 'TextPosition' attribute. This indicates that the text is positioned below the reference point 'Location'

See Also:
  - Constant Field Values

## Constructor Details

### TextRenderEvent

public TextRenderEvent(Object oSource)
The constructor.

## Method Details

### setBlockBounds

public final void setBlockBounds(Bounds boBlock)
Sets the block bounds of the text.

### setRtlCaption

public final void setRtlCaption()
Adds the "RLE" and "PDF" unicode control characters to label caption where "RLE" is added to the beginning and "PDF" to the end to apply right to left reading order

### getBlockBounds

public final Bounds getBlockBounds()

Returns:
  Returns the block bounds of the text.

### setLabel

public final void setLabel(Label la)
Sets the label of the text.

### getLabel

public final Label getLabel()

Overrides:
  `getLabel` in class `PrimitiveRenderEvent`
Returns:
  Returns the label of the text.

### setBlockAlignment

public final void setBlockAlignment(TextAlignment taBlock)
Sets the block alignment of the text.

### getBlockAlignment

public final TextAlignment getBlockAlignment()

Returns:
  Returns the block alignment of the text.

### setAction

public final void setAction(int iAction)
Sets the action of current event. The value must be one of these defined in this class:

- `RENDER_TEXT_AT_LOCATION`
- `RENDER_TEXT_IN_BLOCK`
- `RENDER_SHADOW_AT_LOCATION`

### getAction

public final int getAction()

Returns:
  Returns the action of current event. The value could be one of these defined in this class:
  - `RENDER_TEXT_AT_LOCATION`
  - `RENDER_TEXT_IN_BLOCK`
  - `RENDER_SHADOW_AT_LOCATION`
  - `UNDEFINED`

### setLocation

public final void setLocation(Location lo)
Sets the location of the text.

### getLocation

public final Location getLocation()

Returns:
  Returns the location of the text.

### setTextPosition

public final void setTextPosition(int iTextPosition)
Sets the position of the text. The value must be on of these defined in this class:

- `LEFT`
- `RIGHT`
- `ABOVE`
- `BELOW`

### getTextPosition

public final int getTextPosition()

Returns:
  Returns the position of the text. The value could be on of these defined in this class:
  - `LEFT`
  - `RIGHT`
  - `ABOVE`
  - `BELOW`
  - `UNDEFINED`

### updateFrom

public final void updateFrom(LabelBlock lb, double dScale, RunTimeContext rtc)
Updates the event by given LabelBlock object.

### copy

public PrimitiveRenderEvent copy()

Overrides:
  `copy` in class `PrimitiveRenderEvent`
Returns:
  A copy of this primitive rendering instruction implemented by subclasses

### fill

public void fill(IDeviceRenderer idr) throws ChartException
Description copied from class: `PrimitiveRenderEvent`
Causes this instruction to 'fill' itself on the device renderer

Overrides:
  `fill` in class `PrimitiveRenderEvent`
Parameters:
  `idr` -
Throws:
  `ChartException`

### draw

public final void draw(IDeviceRenderer idr) throws ChartException
Description copied from class: `PrimitiveRenderEvent`
Causes this instruction to 'draw' itself on the device renderer

Overrides:
  `draw` in class `PrimitiveRenderEvent`
Parameters:
  `idr` -
Throws:
  `ChartException`

### reset

public void reset()
Description copied from class: `ChartEvent`
Resets the inner state of current event. This must be implemented if the object is cached and reused.

Specified by:
  `reset` in class `ChartEvent`