本文整理汇总了Java中sun.awt.windows.WComponentPeer.getTarget方法的典型用法代码示例。如果您正苦于以下问题:Java WComponentPeer.getTarget方法的具体用法?Java WComponentPeer.getTarget怎么用?Java WComponentPeer.getTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.awt.windows.WComponentPeer
的用法示例。
在下文中一共展示了WComponentPeer.getTarget方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBackBuffer
import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
* Creates a D3D-based backbuffer for the given peer and returns the
* image wrapper.
*/
@Override
public VolatileImage createBackBuffer(WComponentPeer peer) {
Component target = (Component)peer.getTarget();
// it is possible for the component to have size 0x0, adjust it to
// be at least 1x1 to avoid IAE
int w = Math.max(1, target.getWidth());
int h = Math.max(1, target.getHeight());
return new SunVolatileImage(target, w, h, Boolean.TRUE);
}
示例2: canUseD3DOnScreen
import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
* Determines if we can use a d3d surface for onscreen rendering for this
* peer.
* We only create onscreen d3d surfaces if the following conditions are met:
* - d3d is enabled on this device and onscreen emulation is enabled
* - window is big enough to bother (either dimension > MIN_WIN_SIZE)
* - this heavyweight doesn't have a BufferStrategy
* - if we are in full-screen mode then it must be the peer of the
* full-screen window (since there could be only one SwapChain in fs)
* and it must not have any heavyweight children
* (as Present() doesn't respect component clipping in fullscreen mode)
* - it's one of the classes likely to have custom rendering worth
* accelerating
*
* @returns true if we can use a d3d surface for this peer's onscreen
* rendering
*/
public static boolean canUseD3DOnScreen(final WComponentPeer peer,
final Win32GraphicsConfig gc,
final int bbNum)
{
if (!(gc instanceof D3DGraphicsConfig)) {
return false;
}
D3DGraphicsConfig d3dgc = (D3DGraphicsConfig)gc;
D3DGraphicsDevice d3dgd = d3dgc.getD3DDevice();
String peerName = peer.getClass().getName();
Rectangle r = peer.getBounds();
Component target = (Component)peer.getTarget();
Window fsw = d3dgd.getFullScreenWindow();
return
WindowsFlags.isD3DOnScreenEnabled() &&
d3dgd.isD3DEnabledOnDevice() &&
peer.isAccelCapable() &&
(r.width > MIN_WIN_SIZE || r.height > MIN_WIN_SIZE) &&
bbNum == 0 &&
(fsw == null || (fsw == target && !hasHWChildren(target))) &&
(peerName.equals("sun.awt.windows.WCanvasPeer") ||
peerName.equals("sun.awt.windows.WDialogPeer") ||
peerName.equals("sun.awt.windows.WPanelPeer") ||
peerName.equals("sun.awt.windows.WWindowPeer") ||
peerName.equals("sun.awt.windows.WFramePeer") ||
peerName.equals("sun.awt.windows.WEmbeddedFramePeer"));
}
示例3: repaintPeerTarget
import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
* Posts a repaint event for the peer's target to the EDT
* @param peer for which target's the repaint should be issued
*/
private void repaintPeerTarget(WComponentPeer peer) {
Component target = (Component)peer.getTarget();
Rectangle bounds = AWTAccessor.getComponentAccessor().getBounds(target);
// the system-level painting operations should call the handlePaint()
// method of the WComponentPeer class to repaint the component;
// calling repaint() forces AWT to make call to update()
peer.handlePaint(0, 0, bounds.width, bounds.height);
}
示例4: createBackBuffer
import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
* Creates a WGL-based backbuffer for the given peer and returns the
* image wrapper.
*/
@Override
public VolatileImage createBackBuffer(WComponentPeer peer) {
Component target = (Component)peer.getTarget();
return new SunVolatileImage(target,
target.getWidth(), target.getHeight(),
Boolean.TRUE);
}
示例5: createBackBuffer
import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
* Creates a WGL-based backbuffer for the given peer and returns the
* image wrapper.
*/
@Override
public VolatileImage createBackBuffer(WComponentPeer peer) {
Component target = (Component)peer.getTarget();
// it is possible for the component to have size 0x0, adjust it to
// be at least 1x1 to avoid IAE
int w = Math.max(1, target.getWidth());
int h = Math.max(1, target.getHeight());
return new SunVolatileImage(target,
w, h,
Boolean.TRUE);
}
示例6: canUseD3DOnScreen
import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
* Determines if we can use a d3d surface for onscreen rendering for this
* peer.
* We only create onscreen d3d surfaces if the following conditions are met:
* - d3d is enabled on this device and onscreen emulation is enabled
* - window is big enough to bother (either dimension > MIN_WIN_SIZE)
* - this heavyweight doesn't have a BufferStrategy
* - if we are in full-screen mode then it must be the peer of the
* full-screen window (since there could be only one SwapChain in fs)
* and it must not have any heavyweight children
* (as Present() doesn't respect component clipping in fullscreen mode)
* - it's one of the classes likely to have custom rendering worth
* accelerating
*
* @return true if we can use a d3d surface for this peer's onscreen
* rendering
*/
public static boolean canUseD3DOnScreen(final WComponentPeer peer,
final Win32GraphicsConfig gc,
final int bbNum)
{
if (!(gc instanceof D3DGraphicsConfig)) {
return false;
}
D3DGraphicsConfig d3dgc = (D3DGraphicsConfig)gc;
D3DGraphicsDevice d3dgd = d3dgc.getD3DDevice();
String peerName = peer.getClass().getName();
Rectangle r = peer.getBounds();
Component target = (Component)peer.getTarget();
Window fsw = d3dgd.getFullScreenWindow();
return
WindowsFlags.isD3DOnScreenEnabled() &&
d3dgd.isD3DEnabledOnDevice() &&
peer.isAccelCapable() &&
(r.width > MIN_WIN_SIZE || r.height > MIN_WIN_SIZE) &&
bbNum == 0 &&
(fsw == null || (fsw == target && !hasHWChildren(target))) &&
(peerName.equals("sun.awt.windows.WCanvasPeer") ||
peerName.equals("sun.awt.windows.WDialogPeer") ||
peerName.equals("sun.awt.windows.WPanelPeer") ||
peerName.equals("sun.awt.windows.WWindowPeer") ||
peerName.equals("sun.awt.windows.WFramePeer") ||
peerName.equals("sun.awt.windows.WEmbeddedFramePeer"));
}
示例7: createBackBuffer
import sun.awt.windows.WComponentPeer; //导入方法依赖的package包/类
/**
* This method is called from WComponentPeer when a surface data is replaced
* REMIND: while the default pipeline doesn't support flipping, it may
* happen that the accelerated device may have this graphics config
* (like if the device restoration failed when one device exits fs mode
* while others remain).
*/
public VolatileImage createBackBuffer(WComponentPeer peer) {
Component target = (Component)peer.getTarget();
return new SunVolatileImage(target,
target.getWidth(), target.getHeight(),
Boolean.TRUE);
}