java.awt.Window.isVisible()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(192)

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

Window.isVisible介绍

暂无

代码示例

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

for(Window window : Window.getWindows()){
  if(window != null && window.isVisible() && window instanceof JFrame){
    JFrame jFrame = (JFrame)window;
  }
}

代码示例来源:origin: uk.co.caprica/vlcj

/**
 * Check whether or not there is an overlay component currently enabled.
 *
 * @return true if there is an overlay enabled, otherwise false
 */
public boolean enabled() {
  return overlay != null && overlay.isVisible();
}

代码示例来源:origin: net.java.dev.appframework/appframework

private boolean isVisibleWindow(Window w) {
return w.isVisible() && 
  ((w instanceof JFrame) || (w instanceof JDialog) || (w instanceof JWindow));
}

代码示例来源:origin: org.jdesktop.bsaf/bsaf

private boolean isVisibleWindow(Window w) {
  return w.isVisible() &&
      ((w instanceof JFrame) || (w instanceof JDialog) || (w instanceof JWindow));
}

代码示例来源:origin: hneemann/Digital

/**
   * Returns true if the window with the given id is visible
   *
   * @param id the id of the window
   * @return true if window is visible
   */
  public boolean isVisible(String id) {
    Window w = windows.get(id);
    if (w == null) return false;
    return w.isVisible();
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
  public void run() {
    synchronized (lock) {
      while (window.isVisible()) {
        try {
          lock.wait(500);
        } catch (InterruptedException e) {
        }
      }
    }
  }
};

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

/**
 * Updates the divider component's location to keep the current proportional divider location. 
 */
public void updateDividerLocation() {
  if(!window.isVisible())
    return;
  // Reset the last divider location to make sure that the next call to moveComponent doesn't
  // needlessly recalculate the split ratio.
  lastDividerLocation = -1;
  //setDividerLocation((int)(splitRatio*(getOrientation()==HORIZONTAL_SPLIT?getWidth():getHeight())));
  setDividerLocation(splitRatio);
}

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

for (Window window: Window.getWindows())
{
  if (window.isVisible())
  {
    injectResources(window);
    window.repaint();
    if (window instanceof RootPaneContainer)
    {
      ((RootPaneContainer) window).getRootPane().revalidate();
    }
  }
}

代码示例来源:origin: org.riedelcastro/whatswrong

public void actionPerformed(ActionEvent e) {
    //window.pack();
    window.setVisible(!window.isVisible());
  }
});

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

private void showPalettes() {
  for (Window palette : palettes) {
    if (! palette.isVisible()) {
      palette.setVisible(true);
    }
  }
}

代码示例来源:origin: com.jalalkiswani/jk-desktop

/**
 * Checks if is visible on screen.
 *
 * @param component
 *            the component
 * @return true, if is visible on screen
 */
public static boolean isVisibleOnScreen(final JComponent component) {
  final Window window = getWindow(component);
  if (window != null) {
    return window.isVisible();
  }
  return false;
}

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

private Collection<Window> collectVisibleFrames(Window window) {
  if (!window.isVisible())
    return Collections.emptyList();
  Window[] ownedWindows = window.getOwnedWindows();
  ArrayList<Window> visibleWindows = new ArrayList(ownedWindows.length + 1);
  visibleWindows.add(window);
  for (Window child : ownedWindows) {
    visibleWindows.addAll(collectVisibleFrames(child));
  }
  return visibleWindows;
}

代码示例来源:origin: com.synaptix/SynaptixSwing

public static Window[] getWindows() {
    Window[] ws = Window.getWindows();
    List<Window> res = new ArrayList<Window>();

    for (Window w : ws) {
      if (w instanceof JSyDialog) {
        JSyDialog dialog = (JSyDialog) w;
        if (!dialog.isSeparatedWindow() && w.isVisible()) {
          res.add(w);
        }
      } else {
        if (w.isVisible()) {
          res.add(w);
        }
      }
    }

    return res.toArray(new Window[res.size()]);

  }
}

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

@Command
 public void openWindow(@BindingParam("window") Window win){
   if(!win.isVisible()){
    win.setVisible(true);
    win.doHighlighted();
   }
 }

代码示例来源:origin: JetBrains/jediterm

@NotNull
public static Window getActiveWindow() {
  Window[] windows = Window.getWindows();
  for (Window each : windows) {
    if (each.isVisible() && each.isActive()) return each;
  }
  return JOptionPane.getRootFrame();
}

代码示例来源:origin: org.jspresso.framework/jspresso-swing-components

/**
 * Gets the visible parent window.
 *
 * @param component
 *          the component to start from
 * @return the visible parent window or null.
 */
public static Window getVisibleWindow(Component component) {
 if (component instanceof JWindow) {
  return (JWindow) component;
 }
 Window w = SwingUtilities.getWindowAncestor(component);
 if (w != null && !w.isVisible() && w.getParent() != null) {
  return getVisibleWindow(w.getParent());
 }
 return w;
}

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

public static void backOtherWindows() {
  Component owner = getMenuComponent();
  if(owner instanceof Window){
    final Window[] ownedWindows = ((Window) owner).getOwnedWindows();
    for(Window w : ownedWindows){
      if(w.isVisible()){
        w.toBack();
      }
    }
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-core

private static boolean hasModalDialog(Window w) {
  if (w == null) { // #63830
    return false;
  }
  Window[] ws = w.getOwnedWindows();
  for(int i = 0; i < ws.length; i++) {
    if(ws[i] instanceof Dialog && ((Dialog)ws[i]).isModal() && ws[i].isVisible()) {
      return true;
    } else if(hasModalDialog(ws[i])) {
      return true;
    }
  }
  
  return false;
}

代码示例来源:origin: com.jidesoft/jide-oss

/**
 * Gets the top modal dialog of current window.
 *
 * @param w
 * @return the top modal dialog of current window.
 */
public static Window getTopModalDialog(Window w) {
  Window[] ws = w.getOwnedWindows();
  for (Window w1 : ws) {
    if (w1.isVisible() && w1 instanceof Dialog && ((Dialog) w1).isModal()) {
      return (getTopModalDialog(w1));
    }
  }
  return w;
}

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

private void toFront() {
  final Component menuComponent = UITools.getMenuComponent();
  if(menuComponent instanceof Frame) {
    final Frame frame = (Frame) menuComponent;
    final int state = frame.getExtendedState();
    if ((state & Frame.ICONIFIED) != 0)
      frame.setExtendedState(state & ~Frame.ICONIFIED);
  }
  if(menuComponent instanceof Window) {
    Window window = (Window) menuComponent;
    if (!window.isVisible())
      window.setVisible(true);
    window.toFront();
    window.requestFocus();
  }
}

相关文章

Window类方法