Package java.awt.peer

Examples of java.awt.peer.ComponentPeer


            postProcessKeyEvent(e);
        }

        // Allow the peer to process KeyEvent
        Component source = e.getComponent();
        ComponentPeer peer = source.getPeer();

        if (peer == null || peer instanceof LightweightPeer) {
            // if focus owner is lightweight then its native container
            // processes event
            Container target = source.getNativeContainer();
            if (target != null) {
                peer = target.getPeer();
            }
        }
        if (peer != null) {
            peer.handleEvent(e);
        }

        return true;
    }
View Full Code Here


         */
        if (KeyboardFocusManager.isProxyActive(ke)) {
            Component source = (Component)ke.getSource();
            Container target = source.getNativeContainer();
            if (target != null) {
                ComponentPeer peer = target.getPeer();
                if (peer != null) {
                    peer.handleEvent(ke);
                    /**
                     * Fix for 4478780 - consume event after it was dispatched by peer.
                     */
                    ke.consume();
                }
View Full Code Here

            }
  }
    }

    private boolean coalescePaintEvent(PaintEvent e) {                                
        ComponentPeer sourcePeer = ((Component)e.getSource()).peer;               
        if (sourcePeer != null) {                                                 
            sourcePeer.coalescePaintEvent(e);                                     
        }                                                                         
        EventQueueItem[] cache = ((Component)e.getSource()).eventCache;              
        if (cache == null) {                                                      
            return false;                                                         
        }                                                                         
View Full Code Here

     * @deprecated As of JDK version 1.1,
     * replaced by <code>getInsets()</code>.
     */
    @Deprecated
    public Insets insets() {
        ComponentPeer peer = this.peer;
  if (peer instanceof ContainerPeer) {
      ContainerPeer cpeer = (ContainerPeer)peer;
      return (Insets)cpeer.insets().clone();
  }
  return new Insets(0, 0, 0, 0);
View Full Code Here

     * @param component component
     * @return peer
     */
    private long getViewPointer(Component component) {
        try {
            @SuppressWarnings("deprecation")
            ComponentPeer peer = component.getPeer();
            Method method = peer.getClass().getMethod("getViewPtr");
            Object result = method.invoke(peer);
            System.out.println("result: " + result);
            if(result != null) {
                System.out.println("class: " + result.getClass());
                return Long.parseLong(result.toString());
View Full Code Here

    private static ISwingContainerPeer getContainerPeer(Component component) {
        final Component parent = component.getParent();
        if (parent == null) {
            return null;
        } else {
            final ComponentPeer parentPeer = parent.getPeer();
            if (parentPeer instanceof ISwingContainerPeer) {
                return (ISwingContainerPeer) parentPeer;
            } else {
                return getContainerPeer(parent);
            }
View Full Code Here

        while (heavyParent != null && heavyParent.isLightweight()) {
            heavyParent = heavyParent.getParent();
        }

        if (heavyParent != null) {
            ComponentPeer peer = heavyParent.getPeer();

            if (peer != null && peer.canDetermineObscurity() &&
                                !peer.isObscured()) {
                // The peer says we aren't obscured, therefore we can assume
                // that we won't later be messaged to paint a portion that
                // we tried to blit that wasn't valid.
                // It is certainly possible that when we blited we were
                // obscured, and by the time this is invoked we aren't, but the
View Full Code Here

        boolean focusable = aComponent.isFocusable();
        if (aComponent.isFocusTraversableOverridden()) {
            return focusable;
        }

        ComponentPeer peer = aComponent.getPeer();
        return (peer != null && peer.isFocusable());
    }
View Full Code Here

        }

        synchronized (this) {
            source = newSource;
            if (comp != null) {
                ComponentPeer peer = comp.peer;
                if (peer != null) {
                    nativeSetSource(peer);
                }
            }
        }
View Full Code Here

    public synchronized void setComponent(Component c) {
        if (component == c || component != null && component.equals(c))
            return;

        Component     old;
        ComponentPeer oldPeer = null;

        if ((old = component) != null) {
            clearAutoscroll();

            component = null;
View Full Code Here

TOP

Related Classes of java.awt.peer.ComponentPeer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.