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

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

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

JDialog.isResizable介绍

暂无

代码示例

代码示例来源:origin: eugener/oxbow

public boolean isResizable() {
  return dlg.isResizable();
}

代码示例来源:origin: org.bidib.org.oxbow/swingbits

public boolean isResizable() {
  return dlg.isResizable();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf

/**
 * Gets the Resizable attribute of the SkinWindowWindow object
 * 
 * @return The Resizable value
 */
public boolean isResizable() {
 boolean toreturn = false;
 if (frame != null) {
  toreturn = frame.isResizable();
 } else if (dialog != null) { return dialog.isResizable() && !isShaded(); }
 return toreturn;
}

代码示例来源:origin: com.jtattoo/JTattoo

public boolean isResizable(Component c) {
  boolean resizable = true;
  if (c instanceof JDialog) {
    JDialog dialog = (JDialog) c;
    resizable = dialog.isResizable();
  } else if (c instanceof JInternalFrame) {
    JInternalFrame frame = (JInternalFrame) c;
    resizable = frame.isResizable();
  } else if (c instanceof JRootPane) {
    JRootPane jp = (JRootPane) c;
    if (jp.getParent() instanceof JFrame) {
      JFrame frame = (JFrame) c.getParent();
      resizable = frame.isResizable();
    } else if (jp.getParent() instanceof JDialog) {
      JDialog dialog = (JDialog) c.getParent();
      resizable = dialog.isResizable();
    }
  }
  return resizable;
}

代码示例来源:origin: GoldenGnu/jeveassets

public void setVisible(final boolean b) {
  if (b) {
    LOG.info("Showing: {} Dialog", dialog.getTitle());
    dialog.pack();
    if (dialog.isResizable()) {
      dialog.setMinimumSize(dialog.getSize());
    }
    //Get the parent size
    Dimension screenSize = parent.getSize();
    //Calculate the frame location
    int x = (screenSize.width - dialog.getWidth()) / 2;
    int y = (screenSize.height - dialog.getHeight()) / 2;
    //Set the new frame location
    dialog.setLocation(x, y);
    dialog.setLocationRelativeTo(parent);
    firstActivating = true;
    firstFocus = true;
  } else {
    LOG.info("Hiding: {} Dialog", dialog.getTitle());
  }
  dialog.setVisible(b);
}

代码示例来源:origin: com.github.insubstantial/substance-swingx

@Override
protected void paintBackground(Graphics2D g, JXStatusBar bar) {
  this.bgDelegate.paint(bar, g, true);
  JRootPane rootPane = SwingUtilities.getRootPane(bar);
  Window window = SwingUtilities.getWindowAncestor(bar);
  boolean isResizable = false;
  if (window instanceof JFrame) {
    JFrame frame = (JFrame) window;
    isResizable = frame.isResizable()
        && (frame.getExtendedState() != JFrame.MAXIMIZED_BOTH);
  }
  if (window instanceof JDialog) {
    isResizable = ((JDialog) window).isResizable();
  }
  boolean hasResizeGrip = SubstanceCoreUtilities
      .toShowExtraWidgets(rootPane)
      && isResizable;
  if (hasResizeGrip) {
    int dim = bar.getHeight() * 2 / 3;
    SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
        .getColorScheme(bar, ColorSchemeAssociationKind.SEPARATOR,
            ComponentState.ENABLED);
    BufferedImage resizeImage = SubstanceImageCreator
        .getResizeGripImage(bar, scheme, dim, false);
    g.drawImage(resizeImage, bar.getWidth() - dim, bar.getHeight()
        - dim, null);
  }
}

相关文章

JDialog类方法