當前位置: 首頁>>代碼示例>>Java>>正文


Java KeyEvent.KEY_LOCATION_UNKNOWN屬性代碼示例

本文整理匯總了Java中java.awt.event.KeyEvent.KEY_LOCATION_UNKNOWN屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyEvent.KEY_LOCATION_UNKNOWN屬性的具體用法?Java KeyEvent.KEY_LOCATION_UNKNOWN怎麽用?Java KeyEvent.KEY_LOCATION_UNKNOWN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在java.awt.event.KeyEvent的用法示例。


在下文中一共展示了KeyEvent.KEY_LOCATION_UNKNOWN屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getText

private String getText() {
    CharArray ltrChars = new CharArray();
    String text = "";

    // add only LTR characters into array.
    for (int i = glyphs.size - 1; i >= 0; i--) {
        if (glyphs.get(i).isRTL()) break;

        ltrChars.add(glyphs.get(i).getOriginalChar());
    }

    // fix space between RTL and LTR characters.
    fixSpace(ltrChars);

    // reverse LTR characters and update main glyphs.
    for (int i = glyphs.size - 1; i >= 0; i--) {
        if (glyphs.get(i).isRTL()) break;

        glyphs.get(i).setChar(ltrChars.pop());
    }

    // append glyphs together.
    for (int i = glyphs.size - 1; i >= 0; i--) {
        char c = glyphs.get(i).getChar();
        text += c == KeyEvent.KEY_LOCATION_UNKNOWN ? KeyEvent.VK_SPACE : c;
    }

    return text;
}
 
開發者ID:CrowniAPIs,項目名稱:libGDX-RTL-Language,代碼行數:29,代碼來源:ArFont.java

示例2: fixSpace

/**
 * This method can fix approximately the space between RTL and LTR characters.
 *
 * @param ltrChars contains LTR characters ONLY.
 */
private void fixSpace(CharArray ltrChars) {
    if (ltrChars.size > 0)
        if (ltrChars.first() == KeyEvent.VK_SPACE || ltrChars.first() == KeyEvent.KEY_LOCATION_UNKNOWN) {
            if (ltrChars.first() == KeyEvent.VK_SPACE && ltrChars.peek() == KeyEvent.VK_SPACE)
                return;
            ltrChars.add(ltrChars.removeIndex(0));

        } else if (ltrChars.peek() == KeyEvent.VK_SPACE || ltrChars.peek() == KeyEvent.KEY_LOCATION_UNKNOWN)
            ltrChars.insert(0, ltrChars.pop());

}
 
開發者ID:CrowniAPIs,項目名稱:libGDX-RTL-Language,代碼行數:16,代碼來源:ArFont.java

示例3: create

public final KeyEvent create(int id, int keyCode, char c) {
    return new KeyEvent(component, id, System.currentTimeMillis(), 0, keyCode, c,
            id != KeyEvent.KEY_TYPED ? KeyEvent.KEY_LOCATION_STANDARD : KeyEvent.KEY_LOCATION_UNKNOWN);
}
 
開發者ID:Parabot,項目名稱:Parabot-317-API-Minified-OS-Scape,代碼行數:4,代碼來源:InternalKeyboard.java


注:本文中的java.awt.event.KeyEvent.KEY_LOCATION_UNKNOWN屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。