本文整理了Java中java.awt.Window.isDisplayable()
方法的一些代码示例,展示了Window.isDisplayable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.isDisplayable()
方法的具体详情如下:
包路径:java.awt.Window
类名称:Window
方法名:isDisplayable
暂无
代码示例来源:origin: stackoverflow.com
for (Window w : Window.getWindows()) {
SwingUtilities.updateComponentTreeUI(w);
if (w.isDisplayable() &&
(w instanceof Frame ? !((Frame)w).isResizable() :
w instanceof Dialog ? !((Dialog)w).isResizable() :
true)) w.pack();
}
代码示例来源:origin: jawi/ols
/**
* {@inheritDoc}
*/
@Override
protected String[] getMenuItemNames()
{
final Window[] windows = Window.getWindows();
final List<String> titles = new ArrayList<String>();
for ( Window window : windows )
{
if ( window.isDisplayable() )
{
titles.add( FocusWindowAction.getTitle( window ) );
}
}
return titles.toArray( new String[titles.size()] );
}
代码示例来源:origin: chatty/chatty
public static void updateLookAndFeel() {
for (Window w : Window.getWindows()) {
if (w.isDisplayable()) {
SwingUtilities.updateComponentTreeUI(w);
}
}
}
}
代码示例来源:origin: net.java.dev.jna/platform
private void fixWindowDragging(Window w, String context) {
if (w instanceof RootPaneContainer) {
JRootPane p = ((RootPaneContainer)w).getRootPane();
Boolean oldDraggable = (Boolean)p.getClientProperty(WDRAG);
if (oldDraggable == null) {
p.putClientProperty(WDRAG, Boolean.FALSE);
if (w.isDisplayable()) {
System.err.println(context + "(): To avoid content dragging, " + context + "() must be called before the window is realized, or " + WDRAG + " must be set to Boolean.FALSE before the window is realized. If you really want content dragging, set " + WDRAG + " on the window's root pane to Boolean.TRUE before calling " + context + "() to hide this message.");
}
}
}
}
代码示例来源:origin: org.bidib.org.oxbow/swingbits
@Override
protected void postSetAction(final Boolean visible) {
LOGGER.debug("Run the set action, visible: {}", visible);
if (visible) {
LOGGER.info("Show the task dialog.");
dlg.pack();
// location is set relative to currently active window or dialog owner if no active window found
// this way task dialog stays on the same monitor as it's owner
Window window = dlg.getOwner();
if (window == null) {
window = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
if (window != null && !window.isDisplayable())
window = null;
}
dlg.setLocationRelativeTo(window);
dlg.setVisible(true);
}
else {
LOGGER.info("Hide the task dialog.");
dlg.setVisible(false);
dlg.dispose(); // releases native resources
LOGGER.info("Hide the task dialog finished.");
}
}
};
代码示例来源:origin: net.java.dev.jna/jna-platform
private void fixWindowDragging(Window w, String context) {
if (w instanceof RootPaneContainer) {
JRootPane p = ((RootPaneContainer)w).getRootPane();
Boolean oldDraggable = (Boolean)p.getClientProperty(WDRAG);
if (oldDraggable == null) {
p.putClientProperty(WDRAG, Boolean.FALSE);
if (w.isDisplayable()) {
LOG.log(Level.WARNING, "{0}(): To avoid content dragging, {1}() must be called before the window is realized, or " + WDRAG + " must be set to Boolean.FALSE before the window is realized. If you really want content dragging, set " + WDRAG + " on the window''s root pane to Boolean.TRUE before calling {2}() to hide this message.",
new Object[]{context, context, context});
}
}
}
}
代码示例来源:origin: eugener/oxbow
@Override protected void setValue(Boolean visible) {
if ( visible ) {
// set commands first because they may depend on "visible" property change
content.setCommands(commands, getDesign().isCommandButtonSizeLocked());
}
if ( visible ) {
dlg.pack();
// location is set relative to currently active window or dialog owner if no active window found
// this way task dialog stays on the same monitor as it's owner
Window window = dlg.getOwner();
if ( window == null ) {
window = KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow();
if (window != null && !window.isDisplayable()) window = null;
}
dlg.setLocationRelativeTo( window );
dlg.setVisible(true);
} else {
dlg.dispose(); // releases native resources
}
}
};
代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core
/**
* Refresh UI after LAF change or resizing
*/
public static final void refreshUI() {
for (Window w : Window.getWindows()) {
SwingUtilities.updateComponentTreeUI(w);
if (w.isDisplayable() &&
(w instanceof Frame ? !((Frame)w).isResizable() :
w instanceof Dialog ? !((Dialog)w).isResizable() :
true)) {
w.pack();
}
}
}
代码示例来源:origin: net.java.dev.laf-widget/laf-widget
if (isShowing) {
Window compWindow = SwingUtilities.getWindowAncestor(comp);
if (!compWindow.isDisplayable() || !compWindow.isShowing()
|| !compWindow.isVisible()) {
isShowing = false;
if (w.isDisplayable() && w.isVisible()
&& w.isShowing()) {
w.repaint();
if (w == root)
continue;
if (w.isDisplayable() && w.isVisible() && w.isShowing()) {
if (w.getBounds().intersects(compRect)) {
int winRepaintX = compRect.x
内容来源于网络,如有侵权,请联系作者删除!