@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(); }
@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; }
@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(); }
@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; }
/** * 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); }
public LWLightweightFramePeer(LightweightFrame target, PlatformComponent platformComponent, PlatformWindow platformWindow) { super(target, platformComponent, platformWindow, LWWindowPeer.PeerType.LW_FRAME); }
private LightweightFrame getLwTarget() { return (LightweightFrame)getTarget(); }
@Override public FramePeer createLightweightFrame(LightweightFrame target) { FramePeer peer = new WLightweightFramePeer(target); targetCreatedPeer(target, peer); return peer; }
public WLightweightFramePeer(LightweightFrame target) { super(target); }
private LightweightFrame getLwTarget() { return (LightweightFrame)target; }
XLightweightFramePeer(LightweightFrame target) { super(target); }