Java Code Examples for sun.awt.LightweightFrame

The following are top voted examples for showing how to use sun.awt.LightweightFrame. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: CPlatformLWWindow.java   Source Code and License 6 votes vote down vote up
@Override
public GraphicsDevice getGraphicsDevice() {
    CGraphicsEnvironment ge = (CGraphicsEnvironment)GraphicsEnvironment.
                              getLocalGraphicsEnvironment();

    LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
    int scale = ((LightweightFrame)peer.getTarget()).getScaleFactor();

    Rectangle bounds = ((LightweightFrame)peer.getTarget()).getHostBounds();
    for (GraphicsDevice d : ge.getScreenDevices()) {
        if (d.getDefaultConfiguration().getBounds().intersects(bounds) &&
            ((CGraphicsDevice)d).getScaleFactor() == scale)
        {
            return d;
        }
    }
    // We shouldn't be here...
    return ge.getDefaultScreenDevice();
}
 
Example 2
Project: OpenJSharp   File: WToolkit.java   Source Code and License 6 votes vote down vote up
@Override
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c, int srcActions,
                                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
        return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
Example 3
Project: jdk8u-jdk   File: CPlatformLWWindow.java   Source Code and License 6 votes vote down vote up
@Override
public GraphicsDevice getGraphicsDevice() {
    CGraphicsEnvironment ge = (CGraphicsEnvironment)GraphicsEnvironment.
                              getLocalGraphicsEnvironment();

    LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
    int scale = ((LightweightFrame)peer.getTarget()).getScaleFactor();

    Rectangle bounds = ((LightweightFrame)peer.getTarget()).getHostBounds();
    for (GraphicsDevice d : ge.getScreenDevices()) {
        if (d.getDefaultConfiguration().getBounds().intersects(bounds) &&
            ((CGraphicsDevice)d).getScaleFactor() == scale)
        {
            return d;
        }
    }
    // We shouldn't be here...
    return ge.getDefaultScreenDevice();
}
 
Example 4
Project: jdk8u-jdk   File: WToolkit.java   Source Code and License 6 votes vote down vote up
@Override
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c, int srcActions,
                                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
        return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
Example 5
Project: openjdk-jdk10   File: CPlatformLWWindow.java   Source Code and License 6 votes vote down vote up
@Override
public GraphicsDevice getGraphicsDevice() {
    CGraphicsEnvironment ge = (CGraphicsEnvironment)GraphicsEnvironment.
                              getLocalGraphicsEnvironment();

    LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
    int scale =(int) Math.round(((LightweightFrame)peer.getTarget())
                                                        .getScaleFactorX());

    Rectangle bounds = ((LightweightFrame)peer.getTarget()).getHostBounds();
    for (GraphicsDevice d : ge.getScreenDevices()) {
        if (d.getDefaultConfiguration().getBounds().intersects(bounds) &&
            ((CGraphicsDevice)d).getScaleFactor() == scale)
        {
            return d;
        }
    }
    // We shouldn't be here...
    return ge.getDefaultScreenDevice();
}
 
Example 6
Project: openjdk-jdk10   File: WToolkit.java   Source Code and License 6 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c, int srcActions,
                                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
        return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
Example 7
Project: openjdk9   File: CPlatformLWWindow.java   Source Code and License 6 votes vote down vote up
@Override
public GraphicsDevice getGraphicsDevice() {
    CGraphicsEnvironment ge = (CGraphicsEnvironment)GraphicsEnvironment.
                              getLocalGraphicsEnvironment();

    LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
    int scale = ((LightweightFrame)peer.getTarget()).getScaleFactor();

    Rectangle bounds = ((LightweightFrame)peer.getTarget()).getHostBounds();
    for (GraphicsDevice d : ge.getScreenDevices()) {
        if (d.getDefaultConfiguration().getBounds().intersects(bounds) &&
            ((CGraphicsDevice)d).getScaleFactor() == scale)
        {
            return d;
        }
    }
    // We shouldn't be here...
    return ge.getDefaultScreenDevice();
}
 
Example 8
Project: openjdk9   File: WToolkit.java   Source Code and License 6 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c, int srcActions,
                                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
        return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
Example 9
Project: jdk8u_jdk   File: CPlatformLWWindow.java   Source Code and License 6 votes vote down vote up
@Override
public GraphicsDevice getGraphicsDevice() {
    CGraphicsEnvironment ge = (CGraphicsEnvironment)GraphicsEnvironment.
                              getLocalGraphicsEnvironment();

    LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
    int scale = ((LightweightFrame)peer.getTarget()).getScaleFactor();

    Rectangle bounds = ((LightweightFrame)peer.getTarget()).getHostBounds();
    for (GraphicsDevice d : ge.getScreenDevices()) {
        if (d.getDefaultConfiguration().getBounds().intersects(bounds) &&
            ((CGraphicsDevice)d).getScaleFactor() == scale)
        {
            return d;
        }
    }
    // We shouldn't be here...
    return ge.getDefaultScreenDevice();
}
 
Example 10
Project: jdk8u_jdk   File: WToolkit.java   Source Code and License 6 votes vote down vote up
@Override
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c, int srcActions,
                                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
        return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
Example 11
Project: lookaside_java-1.8.0-openjdk   File: CPlatformLWWindow.java   Source Code and License 6 votes vote down vote up
@Override
public GraphicsDevice getGraphicsDevice() {
    CGraphicsEnvironment ge = (CGraphicsEnvironment)GraphicsEnvironment.
                              getLocalGraphicsEnvironment();

    LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
    int scale = ((LightweightFrame)peer.getTarget()).getScaleFactor();

    Rectangle bounds = ((LightweightFrame)peer.getTarget()).getHostBounds();
    for (GraphicsDevice d : ge.getScreenDevices()) {
        if (d.getDefaultConfiguration().getBounds().intersects(bounds) &&
            ((CGraphicsDevice)d).getScaleFactor() == scale)
        {
            return d;
        }
    }
    // We shouldn't be here...
    return ge.getDefaultScreenDevice();
}
 
Example 12
Project: lookaside_java-1.8.0-openjdk   File: WToolkit.java   Source Code and License 6 votes vote down vote up
@Override
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c, int srcActions,
                                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
        return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
Example 13
Project: infobip-open-jdk-8   File: CPlatformLWWindow.java   Source Code and License 6 votes vote down vote up
@Override
public GraphicsDevice getGraphicsDevice() {
    CGraphicsEnvironment ge = (CGraphicsEnvironment)GraphicsEnvironment.
                              getLocalGraphicsEnvironment();

    LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
    int scale = ((LightweightFrame)peer.getTarget()).getScaleFactor();

    Rectangle bounds = ((LightweightFrame)peer.getTarget()).getHostBounds();
    for (GraphicsDevice d : ge.getScreenDevices()) {
        if (d.getDefaultConfiguration().getBounds().intersects(bounds) &&
            ((CGraphicsDevice)d).getScaleFactor() == scale)
        {
            return d;
        }
    }
    // We shouldn't be here...
    return ge.getDefaultScreenDevice();
}
 
Example 14
Project: infobip-open-jdk-8   File: WToolkit.java   Source Code and License 6 votes vote down vote up
@Override
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c, int srcActions,
                                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
        return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
Example 15
Project: jdk8u-dev-jdk   File: CPlatformLWWindow.java   Source Code and License 6 votes vote down vote up
@Override
public GraphicsDevice getGraphicsDevice() {
    CGraphicsEnvironment ge = (CGraphicsEnvironment)GraphicsEnvironment.
                              getLocalGraphicsEnvironment();

    LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
    int scale = ((LightweightFrame)peer.getTarget()).getScaleFactor();

    Rectangle bounds = ((LightweightFrame)peer.getTarget()).getHostBounds();
    for (GraphicsDevice d : ge.getScreenDevices()) {
        if (d.getDefaultConfiguration().getBounds().intersects(bounds) &&
            ((CGraphicsDevice)d).getScaleFactor() == scale)
        {
            return d;
        }
    }
    // We shouldn't be here...
    return ge.getDefaultScreenDevice();
}
 
Example 16
Project: jdk8u-dev-jdk   File: WToolkit.java   Source Code and License 6 votes vote down vote up
@Override
public <T extends DragGestureRecognizer> T
    createDragGestureRecognizer(Class<T> abstractRecognizerClass,
                                DragSource ds, Component c, int srcActions,
                                DragGestureListener dgl)
{
    final LightweightFrame f = SunToolkit.getLightweightFrame(c);
    if (f != null) {
        return f.createDragGestureRecognizer(abstractRecognizerClass, ds, c, srcActions, dgl);
    }

    if (MouseDragGestureRecognizer.class.equals(abstractRecognizerClass))
        return (T)new WMouseDragGestureRecognizer(ds, c, srcActions, dgl);
    else
        return null;
}
 
Example 17
Project: OpenJSharp   File: WToolkit.java   Source Code and License 5 votes vote down vote up
/**
 * create the peer for a DragSourceContext
 */

@Override
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
    final LightweightFrame f = SunToolkit.getLightweightFrame(dge.getComponent());
    if (f != null) {
        return f.createDragSourceContextPeer(dge);
    }

    return WDragSourceContextPeer.createDragSourceContextPeer(dge);
}
 
Example 18
Project: jdk8u-jdk   File: WToolkit.java   Source Code and License 5 votes vote down vote up
/**
 * create the peer for a DragSourceContext
 */

@Override
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
    final LightweightFrame f = SunToolkit.getLightweightFrame(dge.getComponent());
    if (f != null) {
        return f.createDragSourceContextPeer(dge);
    }

    return WDragSourceContextPeer.createDragSourceContextPeer(dge);
}
 
Example 19
Project: openjdk-jdk10   File: WToolkit.java   Source Code and License 5 votes vote down vote up
/**
 * create the peer for a DragSourceContext
 */

@Override
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
    final LightweightFrame f = SunToolkit.getLightweightFrame(dge.getComponent());
    if (f != null) {
        return f.createDragSourceContextPeer(dge);
    }

    return WDragSourceContextPeer.createDragSourceContextPeer(dge);
}
 
Example 20
Project: openjdk9   File: WToolkit.java   Source Code and License 5 votes vote down vote up
/**
 * create the peer for a DragSourceContext
 */

@Override
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
    final LightweightFrame f = SunToolkit.getLightweightFrame(dge.getComponent());
    if (f != null) {
        return f.createDragSourceContextPeer(dge);
    }

    return WDragSourceContextPeer.createDragSourceContextPeer(dge);
}
 
Example 21
Project: jdk8u_jdk   File: WToolkit.java   Source Code and License 5 votes vote down vote up
/**
 * create the peer for a DragSourceContext
 */

@Override
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
    final LightweightFrame f = SunToolkit.getLightweightFrame(dge.getComponent());
    if (f != null) {
        return f.createDragSourceContextPeer(dge);
    }

    return WDragSourceContextPeer.createDragSourceContextPeer(dge);
}
 
Example 22
Project: lookaside_java-1.8.0-openjdk   File: WToolkit.java   Source Code and License 5 votes vote down vote up
/**
 * create the peer for a DragSourceContext
 */

@Override
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
    final LightweightFrame f = SunToolkit.getLightweightFrame(dge.getComponent());
    if (f != null) {
        return f.createDragSourceContextPeer(dge);
    }

    return WDragSourceContextPeer.createDragSourceContextPeer(dge);
}
 
Example 23
Project: infobip-open-jdk-8   File: WToolkit.java   Source Code and License 5 votes vote down vote up
/**
 * create the peer for a DragSourceContext
 */

@Override
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
    final LightweightFrame f = SunToolkit.getLightweightFrame(dge.getComponent());
    if (f != null) {
        return f.createDragSourceContextPeer(dge);
    }

    return WDragSourceContextPeer.createDragSourceContextPeer(dge);
}
 
Example 24
Project: jdk8u-dev-jdk   File: WToolkit.java   Source Code and License 5 votes vote down vote up
/**
 * create the peer for a DragSourceContext
 */

@Override
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException {
    final LightweightFrame f = SunToolkit.getLightweightFrame(dge.getComponent());
    if (f != null) {
        return f.createDragSourceContextPeer(dge);
    }

    return WDragSourceContextPeer.createDragSourceContextPeer(dge);
}
 
Example 25
Project: OpenJSharp   File: LWLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
public LWLightweightFramePeer(LightweightFrame target,
                              PlatformComponent platformComponent,
                              PlatformWindow platformWindow)
{
    super(target, platformComponent, platformWindow, LWWindowPeer.PeerType.LW_FRAME);
}
 
Example 26
Project: OpenJSharp   File: LWLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
private LightweightFrame getLwTarget() {
    return (LightweightFrame)getTarget();
}
 
Example 27
Project: OpenJSharp   File: WToolkit.java   Source Code and License 4 votes vote down vote up
@Override
public FramePeer createLightweightFrame(LightweightFrame target) {
    FramePeer peer = new WLightweightFramePeer(target);
    targetCreatedPeer(target, peer);
    return peer;
}
 
Example 28
Project: OpenJSharp   File: WLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
public WLightweightFramePeer(LightweightFrame target) {
    super(target);
}
 
Example 29
Project: OpenJSharp   File: WLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
private LightweightFrame getLwTarget() {
    return (LightweightFrame)target;
}
 
Example 30
Project: OpenJSharp   File: XLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
XLightweightFramePeer(LightweightFrame target) {
    super(target);
}
 
Example 31
Project: OpenJSharp   File: XLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
private LightweightFrame getLwTarget() {
    return (LightweightFrame)target;
}
 
Example 32
Project: jdk8u-jdk   File: LWLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
public LWLightweightFramePeer(LightweightFrame target,
                              PlatformComponent platformComponent,
                              PlatformWindow platformWindow)
{
    super(target, platformComponent, platformWindow, LWWindowPeer.PeerType.LW_FRAME);
}
 
Example 33
Project: jdk8u-jdk   File: LWLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
private LightweightFrame getLwTarget() {
    return (LightweightFrame)getTarget();
}
 
Example 34
Project: jdk8u-jdk   File: WToolkit.java   Source Code and License 4 votes vote down vote up
@Override
public FramePeer createLightweightFrame(LightweightFrame target) {
    FramePeer peer = new WLightweightFramePeer(target);
    targetCreatedPeer(target, peer);
    return peer;
}
 
Example 35
Project: jdk8u-jdk   File: WLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
public WLightweightFramePeer(LightweightFrame target) {
    super(target);
}
 
Example 36
Project: jdk8u-jdk   File: WLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
private LightweightFrame getLwTarget() {
    return (LightweightFrame)target;
}
 
Example 37
Project: jdk8u-jdk   File: XLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
XLightweightFramePeer(LightweightFrame target) {
    super(target);
}
 
Example 38
Project: jdk8u-jdk   File: XLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
private LightweightFrame getLwTarget() {
    return (LightweightFrame)target;
}
 
Example 39
Project: openjdk-jdk10   File: XLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
XLightweightFramePeer(LightweightFrame target) {
    super(target);
}
 
Example 40
Project: openjdk-jdk10   File: XLightweightFramePeer.java   Source Code and License 4 votes vote down vote up
private LightweightFrame getLwTarget() {
    return (LightweightFrame)target;
}