javax.swing.AbstractButton.isShowing()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(137)

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

AbstractButton.isShowing介绍

暂无

代码示例

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-runtime

protected boolean canExecuteAction(ActionEvent e) {
  AbstractButton editor = getEditor();
  Objects.requireNonNull(editor);
  if (!editor.isVisible() || !editor.isEnabled()) {
    return false;
  }
  if (editor instanceof JMenuItem) {
    return ((JMenuItem) editor).isArmed();
  }
  return editor.isShowing();
}

代码示例来源:origin: org.java.net.substance/substance

@Override
public void focusGained(FocusEvent e) {
  this.stateTransitionTracker.turnOffModelChangeTracking();
  try {
    super.focusGained(e);
    if (!this.button.isShowing()) {
      // shouldn't happen. Is some lurking Swing bug
      return;
    }
    try {
      PointerInfo pi = MouseInfo.getPointerInfo();
      int px = pi.getLocation().x
          - this.button.getLocationOnScreen().x;
      int py = pi.getLocation().y
          - this.button.getLocationOnScreen().y;
      this.button.getModel()
          .setRollover(this.button.contains(px, py));
    } catch (AccessControlException ace) {
      // sandbox - give up
    }
  } finally {
    this.stateTransitionTracker.onModelStateChanged();
  }
}

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

@Override
public void focusGained(FocusEvent e) {
  this.stateTransitionTracker.turnOffModelChangeTracking();
  try {
    super.focusGained(e);
    if (!this.button.isShowing()) {
      // shouldn't happen. Is some lurking Swing bug
      return;
    }
    try {
      PointerInfo pi = MouseInfo.getPointerInfo();
      if (pi == null) return;  //pointer not on a graphics device
      int px = pi.getLocation().x
          - this.button.getLocationOnScreen().x;
      int py = pi.getLocation().y
          - this.button.getLocationOnScreen().y;
      this.button.getModel()
          .setRollover(this.button.contains(px, py));
    } catch (AccessControlException ace) {
      // sandbox - give up
    }
  } finally {
    this.stateTransitionTracker.onModelStateChanged();
  }
}

相关文章

微信公众号

最新文章

更多

AbstractButton类方法