本文整理汇总了Java中sun.font.BidiUtils.createContiguousOrder方法的典型用法代码示例。如果您正苦于以下问题:Java BidiUtils.createContiguousOrder方法的具体用法?Java BidiUtils.createContiguousOrder怎么用?Java BidiUtils.createContiguousOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.font.BidiUtils
的用法示例。
在下文中一共展示了BidiUtils.createContiguousOrder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeComponentOrder
import sun.font.BidiUtils; //导入方法依赖的package包/类
/**
* Compute the components order from the given components array and
* logical-to-visual character mapping. May return null if canonical.
*/
private static int[] computeComponentOrder(TextLineComponent[] components,
int[] charsLtoV) {
/*
* Create a visual ordering for the glyph sets. The important thing
* here is that the values have the proper rank with respect to
* each other, not the exact values. For example, the first glyph
* set that appears visually should have the lowest value. The last
* should have the highest value. The values are then normalized
* to map 1-1 with positions in glyphs.
*
*/
int[] componentOrder = null;
if (charsLtoV != null && components.length > 1) {
componentOrder = new int[components.length];
int gStart = 0;
for (int i = 0; i < components.length; i++) {
componentOrder[i] = charsLtoV[gStart];
gStart += components[i].getNumCharacters();
}
componentOrder = BidiUtils.createContiguousOrder(componentOrder);
componentOrder = BidiUtils.createInverseMap(componentOrder);
}
return componentOrder;
}