Search in sources :

Example 41 with ComponentPeer

use of java.awt.peer.ComponentPeer in project jdk8u_jdk by JetBrains.

the class X11InputMethod method activate.

/**
     * Activate input method.
     */
public synchronized void activate() {
    clientComponentWindow = getClientComponentWindow();
    if (clientComponentWindow == null)
        return;
    if (lastXICFocussedComponent != null) {
        if (log.isLoggable(PlatformLogger.Level.FINE)) {
            log.fine("XICFocused {0}, AWTFocused {1}", lastXICFocussedComponent, awtFocussedComponent);
        }
    }
    if (pData == 0) {
        if (!createXIC()) {
            return;
        }
        disposed = false;
    }
    /*  reset input context if necessary and set the XIC focus
        */
    resetXICifneeded();
    ComponentPeer lastXICFocussedComponentPeer = null;
    ComponentPeer awtFocussedComponentPeer = getPeer(awtFocussedComponent);
    if (lastXICFocussedComponent != null) {
        lastXICFocussedComponentPeer = getPeer(lastXICFocussedComponent);
    }
    /* If the last XIC focussed component has a different peer as the
           current focussed component, change the XIC focus to the newly
           focussed component.
        */
    if (isLastTemporary || lastXICFocussedComponentPeer != awtFocussedComponentPeer || isLastXICActive != haveActiveClient()) {
        if (lastXICFocussedComponentPeer != null) {
            setXICFocus(lastXICFocussedComponentPeer, false, isLastXICActive);
        }
        if (awtFocussedComponentPeer != null) {
            setXICFocus(awtFocussedComponentPeer, true, haveActiveClient());
        }
        lastXICFocussedComponent = awtFocussedComponent;
        isLastXICActive = haveActiveClient();
    }
    resetCompositionState();
    isActive = true;
}
Also used : ComponentPeer(java.awt.peer.ComponentPeer)

Aggregations

ComponentPeer (java.awt.peer.ComponentPeer)41 LightweightPeer (java.awt.peer.LightweightPeer)10 Component (java.awt.Component)5 Container (java.awt.Container)3 InputContext (java.awt.im.InputContext)2 ConstrainableGraphics (sun.awt.ConstrainableGraphics)2 Pointer (com.sun.jna.Pointer)1 BufferCapabilities (java.awt.BufferCapabilities)1 HeadlessException (java.awt.HeadlessException)1 AffineTransform (java.awt.geom.AffineTransform)1 ColorModel (java.awt.image.ColorModel)1 FramePeer (java.awt.peer.FramePeer)1 IOException (java.io.IOException)1 Method (java.lang.reflect.Method)1 TooManyListenersException (java.util.TooManyListenersException)1 AppContext (sun.awt.AppContext)1 CausedFocusEvent (sun.awt.CausedFocusEvent)1 SunToolkit (sun.awt.SunToolkit)1 WindowClosingListener (sun.awt.WindowClosingListener)1 SunDropTargetEvent (sun.awt.dnd.SunDropTargetEvent)1