Java Code Examples for sun.font.BidiUtils

Following code examples demonstrate how to use sun.font.BidiUtilsfrom java. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use sun.font.BidiUtilsand various code implementation of this class.

  
  private TextLine makeTextLineOnRange(int paramInt1, int paramInt2)
  {
    int[] arrayOfInt1 = null;
    byte[] arrayOfByte = null;
    if (fBidi != null)
    {
      localObject = fBidi.createLineBidi(paramInt1, paramInt2);
      arrayOfByte = BidiUtils.getLevels((Bidi)localObject);
      int[] arrayOfInt2 = BidiUtils.createVisualToLogicalMap(arrayOfByte);
      arrayOfInt1 = BidiUtils.createInverseMap(arrayOfInt2);
    }
    Object localObject = makeComponentsOnRange(paramInt1, paramInt2);
    return new TextLine(fFrc, (TextLineComponent[])localObject, fBaselineOffsets, fChars, paramInt1, paramInt2, arrayOfInt1, arrayOfByte, fIsDirectionLTR);
  } 


            if (n > 1) {
                AbstractDocument d = (AbstractDocument)fv.getDocument();
                Element bidiRoot = d.getBidiRootElement();
                byte[] levels = new byte[n];
                View[] reorder = new View[n];

                for( int i=0; i<n; i++ ) {
                    View v = row.getView(i);
                    int bidiIndex =bidiRoot.getElementIndex(v.getStartOffset());
                    Element bidiElem = bidiRoot.getElement( bidiIndex );
                    levels[i] = (byte)StyleConstants.getBidiLevel(bidiElem.getAttributes());
                    reorder[i] = v;
                }

                BidiUtils.reorderVisually( levels, reorder );
                row.replace(0, n, reorder);
            }