java.awt.Container.getGraphicsConfiguration()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中java.awt.Container.getGraphicsConfiguration()方法的一些代码示例,展示了Container.getGraphicsConfiguration()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Container.getGraphicsConfiguration()方法的具体详情如下:
包路径:java.awt.Container
类名称:Container
方法名:getGraphicsConfiguration

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,

相关文章

微信公众号

最新文章

更多

Container类方法