当前位置: 首页>>代码示例>>Java>>正文


Java LWWindowPeer类代码示例

本文整理汇总了Java中sun.lwawt.LWWindowPeer的典型用法代码示例。如果您正苦于以下问题:Java LWWindowPeer类的具体用法?Java LWWindowPeer怎么用?Java LWWindowPeer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LWWindowPeer类属于sun.lwawt包,在下文中一共展示了LWWindowPeer类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CWarningWindow

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
public CWarningWindow(final Window _ownerWindow, final LWWindowPeer _ownerPeer) {
    super();

    this.ownerPeer = new WeakReference<LWWindowPeer>(_ownerPeer);
    this.ownerWindow = _ownerWindow;

    initialize(null, null, _ownerPeer.getPlatformWindow());

    setOpaque(false);

    String warningString = ownerWindow.getWarningString();
    if (warningString != null) {
        contentView.setToolTip(ownerWindow.getWarningString());
    }

    updateIconSize();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:CWarningWindow.java

示例2: notifyMouseEvent

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
@Override
public void notifyMouseEvent(int id, long when, int button, int x, int y,
                             int screenX, int screenY, int modifiers,
                             int clickCount, boolean popupTrigger,
                             byte[] bdata) {
    LWWindowPeer peer = ownerPeer.get();
    if (id == MouseEvent.MOUSE_EXITED) {
        if (peer != null) {
            peer.updateSecurityWarningVisibility();
        }
    } else if(id == MouseEvent.MOUSE_ENTERED) {
        if (peer != null) {
            peer.updateSecurityWarningVisibility();
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:CWarningWindow.java

示例3: getAWTView

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
/**
 * @return AWTView ptr, a peer of the CPlatformView associated with the toplevel container of the Accessible, if any
 */
private static long getAWTView(Accessible a) {
    Accessible ax = CAccessible.getSwingAccessible(a);
    if (!(ax instanceof Component)) return 0;

    return invokeAndWait(new Callable<Long>() {
        public Long call() throws Exception {
            Component cont = (Component) ax;
            while (cont != null && !(cont instanceof Window)) {
                cont = cont.getParent();
            }
            if (cont != null) {
                LWWindowPeer peer = (LWWindowPeer) cont.getPeer();
                if (peer != null) {
                    return ((CPlatformWindow) peer.getPlatformWindow()).getContentView().getAWTView();
                }
            }
            return 0L;
        }
    }, (Component)ax);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:24,代码来源:CAccessibility.java

示例4: CWarningWindow

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
public CWarningWindow(final Window _ownerWindow, final LWWindowPeer _ownerPeer) {
    super();

    this.ownerPeer = new WeakReference<>(_ownerPeer);
    this.ownerWindow = _ownerWindow;

    initialize(null, null, _ownerPeer.getPlatformWindow());

    setOpaque(false);

    String warningString = ownerWindow.getWarningString();
    if (warningString != null) {
        contentView.setToolTip(ownerWindow.getWarningString());
    }

    updateIconSize();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:CWarningWindow.java

示例5: notifyMouseEvent

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
@Override
public void notifyMouseEvent(int id, long when, int button, int x, int y,
                             int absX, int absY, int modifiers,
                             int clickCount, boolean popupTrigger,
                             byte[] bdata) {
    LWWindowPeer peer = ownerPeer.get();
    if (id == MouseEvent.MOUSE_EXITED) {
        if (peer != null) {
            peer.updateSecurityWarningVisibility();
        }
    } else if(id == MouseEvent.MOUSE_ENTERED) {
        if (peer != null) {
            peer.updateSecurityWarningVisibility();
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:CWarningWindow.java

示例6: getAWTView

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
/**
 * @return AWTView ptr, a peer of the CPlatformView associated with the toplevel container of the Accessible, if any
 */
private static long getAWTView(Accessible a) {
    Accessible ax = CAccessible.getSwingAccessible(a);
    if (!(ax instanceof Component)) return 0;

    return invokeAndWait(new Callable<Long>() {
        public Long call() throws Exception {
            Component cont = (Component) ax;
            while (cont != null && !(cont instanceof Window)) {
                cont = cont.getParent();
            }
            if (cont != null) {
                LWWindowPeer peer = (LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(cont);
                if (peer != null) {
                    return ((CPlatformWindow) peer.getPlatformWindow()).getContentView().getAWTView();
                }
            }
            return 0L;
        }
    }, (Component)ax);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:CAccessibility.java

示例7: notifyMouseEvent

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
@Override
public void notifyMouseEvent(PlatformWindow platformWindow, int id, long when, int button, int x, int y,
                             int screenX, int screenY, int modifiers,
                             int clickCount, boolean popupTrigger,
                             byte[] bdata) {
    LWWindowPeer peer = ownerPeer.get();
    if (id == MouseEvent.MOUSE_EXITED) {
        if (peer != null) {
            peer.updateSecurityWarningVisibility();
        }
    } else if(id == MouseEvent.MOUSE_ENTERED) {
        if (peer != null) {
            peer.updateSecurityWarningVisibility();
        }
    }
}
 
开发者ID:JetBrains,项目名称:jdk8u_jdk,代码行数:17,代码来源:CWarningWindow.java

示例8: addNotify

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
public void addNotify() {
    if (getPeer() == null) {
        LWCToolkit toolkit = (LWCToolkit)Toolkit.getDefaultToolkit();
        LWWindowPeer peer = toolkit.createEmbeddedFrame(this);
        setPeer(peer);
        responder = new CPlatformResponder(peer, true);
    }
    super.addNotify();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:CEmbeddedFrame.java

示例9: initialize

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
public void initialize(LWWindowPeer peer, CPlatformResponder responder) {
    initializeBase(peer, responder);

    if (!LWCToolkit.getSunAwtDisableCALayers()) {
        this.windowLayer = createCGLayer();
    }
    setPtr(nativeCreateView(0, 0, 0, 0, getWindowLayerPtr()));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:CPlatformView.java

示例10: dragMouseMoved

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
/**
 * upcall from native code
 */
private void dragMouseMoved(final int targetActions,
                            final int modifiers,
                            final int x, final int y) {

    try {
        Component componentAt = LWCToolkit.invokeAndWait(
                new Callable<Component>() {
                    @Override
                    public Component call() {
                        LWWindowPeer mouseEventComponent = LWWindowPeer.getWindowUnderCursor();
                        if (mouseEventComponent == null) {
                            return null;
                        }
                        Component root = SwingUtilities.getRoot(mouseEventComponent.getTarget());
                        if (root == null) {
                            return null;
                        }
                        Point rootLocation = root.getLocationOnScreen();
                        return getDropTargetAt(root, x - rootLocation.x, y - rootLocation.y);
                    }
                }, getComponent());

        if(componentAt != hoveringComponent) {
            if(hoveringComponent != null) {
                dragExit(x, y);
            }
            if(componentAt != null) {
                dragEnter(targetActions, modifiers, x, y);
            }
            hoveringComponent = componentAt;
        }

        postDragSourceDragEvent(targetActions, modifiers, x, y,
                DISPATCH_MOUSE_MOVED);
    } catch (Exception e) {
        throw new InvalidDnDOperationException("Failed to handle DragMouseMoved event");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:42,代码来源:CDragSourceContextPeer.java

示例11: synthesizeWindowActivation

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
@Override
public void synthesizeWindowActivation(boolean activated) {
    if (isActive != activated) {
        isActive = activated;
        ((LWWindowPeer)getPeer()).notifyActivation(activated, null);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:CViewEmbeddedFrame.java

示例12: validateWithBounds

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public void validateWithBounds(final int x, final int y, final int width, final int height) {
    try {
        LWCToolkit.invokeAndWait(new Runnable() {
            @Override
            public void run() {
                ((LWWindowPeer) getPeer()).setBoundsPrivate(0, 0, width, height);
                validate();
                setVisible(true);
            }
        }, this);
    } catch (InvocationTargetException ex) {}
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:CViewEmbeddedFrame.java

示例13: initialize

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
@Override // PlatformWindow
public void initialize(Window target, final LWWindowPeer peer, PlatformWindow owner) {
    this.peer = peer;
    this.target = (CViewEmbeddedFrame) target;
    responder = new CPlatformResponder(peer, false);

    view = new CPlatformView();
    view.initialize(peer, responder);

    CWrapper.NSView.addSubview(this.target.getEmbedderHandle(), view.getAWTView());
    view.setAutoResizable(true);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:CViewPlatformEmbeddedFrame.java

示例14: addNotify

import sun.lwawt.LWWindowPeer; //导入依赖的package包/类
public void addNotify() {
    if (!isDisplayable()) {
        LWCToolkit toolkit = (LWCToolkit)Toolkit.getDefaultToolkit();
        LWWindowPeer peer = toolkit.createEmbeddedFrame(this);
        setPeer(peer);
        responder = new CPlatformResponder(peer, true);
    }
    super.addNotify();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:CEmbeddedFrame.java


注:本文中的sun.lwawt.LWWindowPeer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。