本文整理了Java中java.awt.Container.getGraphicsConfiguration()
方法的一些代码示例,展示了Container.getGraphicsConfiguration()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Container.getGraphicsConfiguration()
方法的具体详情如下:
包路径:java.awt.Container
类名称:Container
方法名:getGraphicsConfiguration
暂无
代码示例来源:origin: net.sf.sf3jswing/kernel-core
JFrame jf = new JFrame(parent != null ? parent.getGraphicsConfiguration() : JXAenvUtils._defaultGC);
jf.setContentPane(popupPanel);
jf.setUndecorated(true);
代码示例来源:origin: jfree/jfreechart
/**
* Positions the specified dialog at a position relative to its parent.
*
* @param dialog the dialog to be positioned.
* @param horizontalPercent the relative location.
* @param verticalPercent the relative location.
*/
public static void positionDialogRelativeToParent(Dialog dialog,
double horizontalPercent, double verticalPercent) {
Container parent = dialog.getParent();
if (parent == null) {
centerFrameOnScreen(dialog);
return;
}
Dimension d = dialog.getSize();
Dimension p = parent.getSize();
int baseX = parent.getX();
int baseY = parent.getY();
int x = baseX + (int) (horizontalPercent * p.width);
int y = baseY + (int) (verticalPercent * p.height);
// make sure the dialog fits completely on the screen...
Rectangle s = parent.getGraphicsConfiguration().getBounds();
Rectangle r = new Rectangle(x, y, d.width, d.height);
dialog.setBounds(r.intersection(s));
}
代码示例来源:origin: pentaho/pentaho-reporting
final Rectangle s = parent.getGraphicsConfiguration().getBounds();
final Rectangle r = new Rectangle( dialogPointX, dialogPointY, d.width, d.height );
final Rectangle intersectedDialogBounds = r.intersection( s );
代码示例来源:origin: org.jfree/jcommon
/**
* Positions the specified dialog at a position relative to its parent.
*
* @param dialog the dialog to be positioned.
* @param horizontalPercent the relative location.
* @param verticalPercent the relative location.
*/
public static void positionDialogRelativeToParent(final Dialog dialog,
final double horizontalPercent,
final double verticalPercent) {
final Container parent = dialog.getParent();
if (parent == null)
{
centerFrameOnScreen(dialog);
return;
}
final Dimension d = dialog.getSize();
final Dimension p = parent.getSize();
final int baseX = parent.getX();
final int baseY = parent.getY();
final int x = baseX + (int) (horizontalPercent * p.width);
final int y = baseY + (int) (verticalPercent * p.height);
// make sure the dialog fits completely on the screen...
final Rectangle s = parent.getGraphicsConfiguration().getBounds();
final Rectangle r = new Rectangle(x, y, d.width, d.height);
dialog.setBounds(r.intersection(s));
}
代码示例来源:origin: pentaho/pentaho-reporting
final Rectangle s = parent.getGraphicsConfiguration().getBounds();
final Rectangle r = new Rectangle( dialogPointX, dialogPointY, d.width, d.height );
final Rectangle intersectedDialogBounds = r.intersection( s );
代码示例来源:origin: mucommander/mucommander
robot = new Robot(getTopLevelAncestor().getGraphicsConfiguration().getDevice());
代码示例来源:origin: org.jclarion/clarion-runtime
(r.height - p.y) / 2 - 10);
} else {
Rectangle r = win.getGraphicsConfiguration()
.getBounds();
win.setLocation((r.width - p.x) / 2,
内容来源于网络,如有侵权,请联系作者删除!