本文整理汇总了Java中com.ibm.icu.text.Bidi.DIRECTION_RIGHT_TO_LEFT属性的典型用法代码示例。如果您正苦于以下问题:Java Bidi.DIRECTION_RIGHT_TO_LEFT属性的具体用法?Java Bidi.DIRECTION_RIGHT_TO_LEFT怎么用?Java Bidi.DIRECTION_RIGHT_TO_LEFT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.ibm.icu.text.Bidi
的用法示例。
在下文中一共展示了Bidi.DIRECTION_RIGHT_TO_LEFT属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
public void initialize( ) throws BirtException
{
hasStyle = false;
boxStyle = BoxStyle.DEFAULT;
localProperties = LocalProperties.DEFAULT;
maxAvaWidth = parent.getCurrentMaxContentWidth( );
width = maxAvaWidth;
// Derive the baseLevel from the parent content direction.
if ( parent.content != null )
{
// IContent#isDirectionRTL already looks at computed style
if ( parent.content.isDirectionRTL( ) )
baseLevel = Bidi.DIRECTION_RIGHT_TO_LEFT;
}
//parent.add( this );
}
示例2: initialize
protected void initialize( )
{
int currentIP = 0;
if(contextList.size()>0)
{
currentIP = contextList.get(contextList.size()-1).currentIP;
}
currentContext = new ContainerContext( );
currentContext.currentIP = currentIP;
contextList.add( currentContext );
createRoot( );
currentContext.maxAvaWidth = parent.getCurrentMaxContentWidth( );
currentContext.maxAvaHeight = parent.getCurrentMaxContentHeight( );
currentContext.root.setWidth( parent.getCurrentMaxContentWidth( ) );
lineHeight = ( (BlockStackingLayout) parent ).getLineHeight( );
// Derive the baseLevel from the parent content direction.
if ( parent.content != null )
{
if ( CSSConstants.CSS_RTL_VALUE.equals( parent.content
.getComputedStyle( ).getDirection( ) ) )
baseLevel = Bidi.DIRECTION_RIGHT_TO_LEFT;
}
}
示例3: directionFromFlags
private byte directionFromFlags() {
/* if the text contains AN and neutrals, then some neutrals may become RTL */
if (!((flags & MASK_RTL) != 0 ||
((flags & DirPropFlag(AN)) != 0 &&
(flags & MASK_POSSIBLE_N) != 0))) {
return Bidi.DIRECTION_LEFT_TO_RIGHT;
} else if ((flags & MASK_LTR) == 0) {
return Bidi.DIRECTION_RIGHT_TO_LEFT;
} else {
return MIXED;
}
}
示例4: requiresBidi
/**
* Return true if the specified text requires bidi analysis. If this returns
* false, the text will display left-to-right. Clients can then avoid
* constructing a Bidi object. Text in the Arabic Presentation Forms area of
* Unicode is presumed to already be shaped and ordered for display, and so
* will not cause this method to return true.
*
* @param text the text containing the characters to test
* @param start the start of the range of characters to test
* @param limit the limit of the range of characters to test
*
* @return true if the range of characters requires bidi analysis
*
* @stable ICU 3.8
*/
public static boolean requiresBidi(char[] text,
int start,
int limit)
{
final int RTLMask = (1 << Bidi.DIRECTION_RIGHT_TO_LEFT |
1 << AL |
1 << RLE |
1 << RLO |
1 << AN);
if (0 > start || start > limit || limit > text.length) {
throw new IllegalArgumentException("Value start " + start +
" is out of range 0 to " + limit);
}
for (int i = start; i < limit; ++i) {
if (Character.isHighSurrogate(text[i]) && i < (limit-1) &&
Character.isLowSurrogate(text[i+1])) {
if (((1 << UCharacter.getDirection(Character.codePointAt(text, i))) & RTLMask) != 0) {
return true;
}
} else if (((1 << UCharacter.getDirection(text[i])) & RTLMask) != 0) {
return true;
}
}
return false;
}
示例5: createControl
@Override
protected void createControl(Composite parent, int styles) {
// Use LEFT_TO_RIGHT unless otherwise specified.
if ((styles & SWT.RIGHT_TO_LEFT) == 0 && (styles & SWT.LEFT_TO_RIGHT) == 0)
styles |= SWT.LEFT_TO_RIGHT;
final int baseLevel= (styles & SWT.RIGHT_TO_LEFT) != 0 ? Bidi.DIRECTION_RIGHT_TO_LEFT : Bidi.DIRECTION_LEFT_TO_RIGHT;
super.createControl(parent, styles);
fBackspaceManager= new SmartBackspaceManager();
fBackspaceManager.install(this);
StyledText text= getTextWidget();
text.addBidiSegmentListener(new BidiSegmentListener() {
public void lineGetSegments(BidiSegmentEvent event) {
if (redraws()) {
try {
event.segments= getBidiLineSegments(getDocument(), baseLevel, widgetOffset2ModelOffset(event.lineOffset), event.lineText);
} catch (BadLocationException e) {
// don't touch the segments
}
}
}
});
}
示例6: ChunkGenerator
public ChunkGenerator( FontMappingManager fontManager,
ITextContent textContent, boolean bidiProcessing,
boolean fontSubstitution )
{
this.fontManager = fontManager;
this.textContent = textContent;
this.text = textContent.getText();
this.bidiProcessing = bidiProcessing;
this.fontSubstitution = fontSubstitution;
if ( text == null || text.length( ) == 0 )
return;
if ( bidiProcessing )
{
//FIXME implement the getDirection() method in ComputedStyle.
if ( CSSConstants.CSS_RTL_VALUE.equals( textContent
.getComputedStyle( ).getDirection( ) ) )
{
bidiSplitter = new BidiSplitter( new Chunk( text, 0,
Bidi.DIRECTION_RIGHT_TO_LEFT,
Bidi.DIRECTION_RIGHT_TO_LEFT ) );
}
else
{
bidiSplitter = new BidiSplitter( new Chunk( text, 0,
Bidi.DIRECTION_LEFT_TO_RIGHT,
Bidi.DIRECTION_LEFT_TO_RIGHT ) );
}
}
if ( null == bidiSplitter )
{
fontSplitter = new FontSplitter( fontManager, new Chunk( text ),
textContent, fontSubstitution );
}
else
{
if ( bidiSplitter.hasMore( ) )
{
fontSplitter = new FontSplitter( fontManager, bidiSplitter
.getNext( ), textContent, fontSubstitution );
}
}
}
示例7: isRightToLeft
/**
* Return true if the line is all right-to-left text, and the base direction
* is right-to-left
*
* @return true if the line is all right-to-left text, and the base
* direction is right-to-left
*
* @throws IllegalStateException if this call is not preceded by a successful
* call to <code>setPara</code>
* @stable ICU 3.8
*/
public boolean isRightToLeft()
{
return (getDirection() == Bidi.DIRECTION_RIGHT_TO_LEFT && (paraLevel & 1) == 1);
}