Eclipse Draw2d
3.0

org.eclipse.draw2d.text
Class BidiProcessor

java.lang.Object
  extended byorg.eclipse.draw2d.text.BidiProcessor

public final class BidiProcessor
extends Object

A helper class for a BlockFlow that does Bidi evaluation of all the text in that block.

WARNING: This class is not intended to be subclassed by clients. This class is for INTERNAL use only.

Since:
3.1

Field Summary
static BidiProcessor INSTANCE
          A singleton instance.
 
Method Summary
 void add(FlowFigure fig, String str)
          FlowFigures can make textual contributions for its block.
 void addControlText(String str)
          This methods allows FlowFigures to contribute text that may effect the bidi evaluation, but is not text that is visible on the screen.
 void process()
          Processes the contributed text, determines the Bidi levels, and assigns them to the FlowFigures that made thet contributions.
 void setOrientation(int newOrientation)
          Sets the paragraph embedding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final BidiProcessor INSTANCE
A singleton instance.

Method Detail

add

public void add(FlowFigure fig,
                String str)
FlowFigures can make textual contributions for its block. All contributions are concatenated (in the order that they were contributed) to make the final String which will determine the Bidi levels.

Parameters:
fig - the figure that is contributing the given text
str - the text contributed by the given figure
See Also:
addControlText(String)

addControlText

public void addControlText(String str)
This methods allows FlowFigures to contribute text that may effect the bidi evaluation, but is not text that is visible on the screen. The bidi level of such text is reported back to the contributing figure.

Parameters:
str - the contributed text

process

public void process()
Processes the contributed text, determines the Bidi levels, and assigns them to the FlowFigures that made thet contributions. Shaping of visually contiguous Arabic characters that are split in different figures is also handled. This method will do nothing if the contributed text does not require Bidi evaluation. All contributions are discarded at the end of this method.

The assigned Bidi levels are in the form on an int array that contains sets of the Bidi level and the offset of the first character that that level applies to. For instance, {1, 0, 2, 5, 1, 9} would mean that characters at index 0-4 are of level 1, 5-8 of level 2 and the remaining characters (starting at offset 9) are of level 1.


setOrientation

public void setOrientation(int newOrientation)
Sets the paragraph embedding. The given orientation will be used on TextLayout when determining the Bidi levels.

Parameters:
newOrientation - SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT

Eclipse Draw2d
3.0

Copyright (c) IBM Corp. and others 2000, 2004. All Rights Reserved.