Java Code Examples for java.awt.im.InputMethodHighlight#isSelected()

The following examples show how to use java.awt.im.InputMethodHighlight#isSelected() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: X11InputMethod.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 2
Source File: X11InputMethod.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 3
Source File: X11InputMethod.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 4
Source File: X11InputMethod.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 5
Source File: ComposedTextHighlighting.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private AttributeSet translateAttributes(Map<AttributedCharacterIterator.Attribute, ?> source) {
    for(AttributedCharacterIterator.Attribute sourceKey : source.keySet()) {
        Object sourceValue = source.get(sourceKey);
        
        // Ignore any non-input method related highlights
        if (!(sourceValue instanceof InputMethodHighlight)) {
            continue;
        }
        
        InputMethodHighlight imh = (InputMethodHighlight) sourceValue;
        
        if (imh.isSelected()) {
            return highlightInverse;
        } else {
            return highlightUnderlined;
        }
    }
    
    LOG.fine("No translation for " + source);
    return SimpleAttributeSet.EMPTY;
}
 
Example 6
Source File: X11InputMethod.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 7
Source File: X11InputMethod.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 8
Source File: X11InputMethod.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 9
Source File: X11InputMethod.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 10
Source File: X11InputMethod.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 11
Source File: X11InputMethod.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 12
Source File: X11InputMethod.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 13
Source File: X11InputMethod.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}
 
Example 14
Source File: X11InputMethod.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see java.awt.Toolkit#mapInputMethodHighlight
 */
public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
    int index;
    int state = highlight.getState();
    if (state == InputMethodHighlight.RAW_TEXT) {
        index = 0;
    } else if (state == InputMethodHighlight.CONVERTED_TEXT) {
        index = 2;
    } else {
        return null;
    }
    if (highlight.isSelected()) {
        index += 1;
    }
    return highlightStyles[index];
}