protected int layoutRow(FlowView fv,int rowIndex,int p0){
  int p1=super.layoutRow(fv,rowIndex,p0);
  View row=fv.getView(rowIndex);
  Document doc=fv.getDocument();
  Object i18nFlag=doc.getProperty(AbstractDocument.I18NProperty);
  if ((i18nFlag != null) && i18nFlag.equals(Boolean.TRUE)) {
    int n=row.getViewCount();
    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);
    }
  }
  return p1;
}

protected int layoutRow ( FlowView fv , int rowIndex , int p0 ) { int p1 = super . layoutRow ( fv , rowIndex , p0 ) ; View row = fv . getView ( rowIndex ) ; Document doc = fv . getDocument ( ) ; Object i18nFlag = doc . getProperty ( AbstractDocument . I18NProperty ) ; if ( ( i18nFlag != null ) && i18nFlag . equals ( Boolean . TRUE ) ) { int n = row . getViewCount ( ) ; 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 ) ; } } return p1 ; }
creates a row of views that will fit within the layout span of the row . this is implemented to execute the superclass functionality ( which fills the row with child views or view fragments ) and follow that with bidi reordering of the unidirectional view fragments .
