javax.swing.JDialog.getBounds()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(125)

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

JDialog.getBounds介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

final JDialog dialog = new JDialog();
dialog.addComponentListener(new ComponentAdapter()
{
  @Override
  public void componentMoved(ComponentEvent e)
  {
    if (dialog.getBounds().intersects(toolbar.getBounds()))
      moveToAvoidConflict(dialog);
  }
}

代码示例来源:origin: igniterealtime/Spark

@Override
public void componentResized( ComponentEvent e )
{
  LayoutSettingsManager.getLayoutSettings().setConferenceRoomBrowserBounds( dlg.getBounds() );
}

代码示例来源:origin: igniterealtime/Spark

@Override
  public void componentMoved( ComponentEvent e )
  {
    LayoutSettingsManager.getLayoutSettings().setVCardEditorBounds( dlg.getBounds() );
  }
} );

代码示例来源:origin: igniterealtime/Spark

@Override
  public void componentMoved( ComponentEvent e )
  {
    LayoutSettingsManager.getLayoutSettings().setPluginViewerBounds( dialog.getBounds() );
  }
} );

代码示例来源:origin: igniterealtime/Spark

@Override
public void componentResized( ComponentEvent e )
{
  LayoutSettingsManager.getLayoutSettings().setBroadcastMessageBounds( dlg.getBounds() );
}

代码示例来源:origin: igniterealtime/Spark

@Override
public void componentResized( ComponentEvent e )
{
  LayoutSettingsManager.getLayoutSettings().setVCardEditorBounds( dlg.getBounds() );
}

代码示例来源:origin: igniterealtime/Spark

@Override
  public void componentMoved( ComponentEvent e )
  {
    LayoutSettingsManager.getLayoutSettings().setPreferencesBounds( preferenceDialog.getBounds() );
  }
} );

代码示例来源:origin: igniterealtime/Spark

@Override
public void componentResized( ComponentEvent e )
{
  LayoutSettingsManager.getLayoutSettings().setPluginViewerBounds( dialog.getBounds() );
}

代码示例来源:origin: igniterealtime/Spark

@Override
  public void componentMoved( ComponentEvent e )
  {
    LayoutSettingsManager.getLayoutSettings().setConferenceRoomBrowserBounds( dlg.getBounds() );
  }
} );

代码示例来源:origin: igniterealtime/Spark

@Override
public void componentResized( ComponentEvent e )
{
  LayoutSettingsManager.getLayoutSettings().setPreferencesBounds( preferenceDialog.getBounds() );
}

代码示例来源:origin: igniterealtime/Spark

@Override
  public void componentMoved( ComponentEvent e )
  {
    LayoutSettingsManager.getLayoutSettings().setBroadcastMessageBounds( dlg.getBounds() );
  }
} );

代码示例来源:origin: cmu-phil/tetrad

/**
 * Sets the location on the given dialog for the given index.
 */
private void setLocation(JDialog dialog, int index) {
  Rectangle bounds = dialog.getBounds();
  JFrame frame = findOwner();
  Dimension dim;
  if (frame == null) {
    dim = Toolkit.getDefaultToolkit().getScreenSize();
  } else {
    dim = frame.getSize();
  }
  int x = (int) (150 * Math.cos(index * 15 * (Math.PI / 180)));
  int y = (int) (150 * Math.sin(index * 15 * (Math.PI / 180)));
  x += (dim.width - bounds.width)/2;
  y += (dim.height - bounds.height)/2;
  dialog.setLocation(x, y);
}

代码示例来源:origin: cmu-phil/tetrad

/**
 * Sets the location on the given dialog for the given index.
 */
private void setLocation(JDialog dialog, int index) {
  Rectangle bounds = dialog.getBounds();
  JFrame frame = findOwner();
  Dimension dim;
  if (frame == null) {
    dim = Toolkit.getDefaultToolkit().getScreenSize();
  } else {
    dim = frame.getSize();
  }
  int x = (int) (150 * Math.cos(index * 15 * (Math.PI / 180)));
  int y = (int) (150 * Math.sin(index * 15 * (Math.PI / 180)));
  x += (dim.width - bounds.width)/2;
  y += (dim.height - bounds.height)/2;
  dialog.setLocation(x, y);
}

代码示例来源:origin: cmu-phil/tetrad

/**
 * Sets the location on the given dialog for the given index.
 */
private void setLocation(JDialog dialog, int index) {
  Rectangle bounds = dialog.getBounds();
  JFrame frame = findOwner();
  Dimension dim;
  if (frame == null) {
    dim = Toolkit.getDefaultToolkit().getScreenSize();
  } else {
    dim = frame.getSize();
  }
  int x = (int) (150 * Math.cos(index * 15 * (Math.PI / 180)));
  int y = (int) (150 * Math.sin(index * 15 * (Math.PI / 180)));
  x += (dim.width - bounds.width)/2;
  y += (dim.height - bounds.height)/2;
  dialog.setLocation(x, y);
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-common

private void validateBounds(){
  Rectangle bounds = dialog.getBounds();

代码示例来源:origin: xyz.cofe/docking-frames-ext-toolbar

private void validateBounds(){
  Rectangle bounds = dialog.getBounds();

代码示例来源:origin: xyz.cofe/docking-frames-common

private void validateBounds(){
  Rectangle bounds = dialog.getBounds();

代码示例来源:origin: AliView/AliView

private void makeSureWithinBounds(JDialog dialog, AliViewWindow aliViewWindow) {
  Rectangle smaller = dialog.getBounds();
  Rectangle larger = aliViewWindow.getBounds();
  int topDiff = larger.x - smaller.x;
  int bottomDiff = larger.y + larger.height - (smaller.y + smaller.height);
  if(topDiff > 0){
    dialog.setLocation(smaller.x, larger.y);
  }
  if(bottomDiff < 0){
    dialog.setLocation(smaller.x, smaller.y + bottomDiff);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.plugins/graph

private void showFrameWindow(Rectangle bounds, String title)
{
 if(null != _dlgWindow)
 {
   title = _dlgWindow.getTitle();
   bounds = _dlgWindow.getBounds();
   Point locOnScreen = _dlgWindow.getLocationOnScreen();
   bounds.x = locOnScreen.x;
   bounds.y = locOnScreen.y;
   _dlgWindow.setVisible(false);
   _dlgWindow.removeWindowListener(_windowAdapter);
   _dlgWindow.getContentPane().removeAll();
   _dlgWindow.dispose();
   _dlgWindow = null;
 }
 ImageIcon appIcon = _session.getApplication().getResources().getIcon(SquirrelResources.IImageNames.APPLICATION_ICON);
 _frameWindow = new JFrame();
 _frameWindow.setTitle(title);
 _frameWindow.setIconImage(appIcon.getImage());
 _frameWindow.getContentPane().setLayout(new GridLayout(1, 1));
 _frameWindow.getContentPane().add(_contentPanel);
 _frameWindow.setBounds(bounds);
 _frameWindow.addWindowListener(_windowAdapter);
 _frameWindow.setVisible(true);
}

代码示例来源:origin: freeplane/freeplane

dialog.pack();
UITools.setDialogLocationRelativeTo(dialog, showEditorBtn);
bounds = dialog.getBounds();

相关文章

JDialog类方法