当前位置: 首页>>代码示例>>Java>>正文


Java Frame.ICONIFIED属性代码示例

本文整理汇总了Java中java.awt.Frame.ICONIFIED属性的典型用法代码示例。如果您正苦于以下问题:Java Frame.ICONIFIED属性的具体用法?Java Frame.ICONIFIED怎么用?Java Frame.ICONIFIED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.Frame的用法示例。


在下文中一共展示了Frame.ICONIFIED属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: notifyClientWindowChange

private synchronized void notifyClientWindowChange(Window window) {
    if (inputMethod == null) {
        return;
    }

    // if the window is invisible or iconified, send null to the input method.
    if (!window.isVisible() ||
        ((window instanceof Frame) && ((Frame)window).getState() == Frame.ICONIFIED)) {
        clientWindowLocation = null;
        inputMethod.notifyClientWindowChange(null);
        return;
    }
    Rectangle location = window.getBounds();
    if (clientWindowLocation == null || !clientWindowLocation.equals(location)) {
        clientWindowLocation = location;
        inputMethod.notifyClientWindowChange(clientWindowLocation);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:InputContext.java

示例2: windowStateChanged

@Override
public void windowStateChanged(WindowEvent e) {
  if (e.getNewState() == Frame.ICONIFIED) {
    Game.getRenderLoop().setMaxFps(ICONIFIED_MAX_FPS);
  } else {
    Game.getRenderLoop().setMaxFps(Game.getConfiguration().client().getMaxFps());
  }
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:8,代码来源:ScreenManager.java

示例3: windowStateChanged

public @Override void windowStateChanged(WindowEvent windowEvent) {
            if (showingPopup) {
                int oldState = windowEvent.getOldState();
                int newState = windowEvent.getNewState();
            
                if (((oldState & Frame.ICONIFIED) == 0) &&
                    ((newState & Frame.ICONIFIED) == Frame.ICONIFIED)) {
                    hidePopup();
//                } else if (((oldState & Frame.ICONIFIED) == Frame.ICONIFIED) && 
//                           ((newState & Frame.ICONIFIED) == 0 )) {
//                    //TODO remember we showed before and show again? I guess not worth the efford, not part of spec.
                }
            }

        }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:StatusLineComponent.java

示例4: getState

int getState(XDecoratedPeer window) {
    int res = 0;
    final int wm_state = window.getWMState();
    if (wm_state == XUtilConstants.IconicState) {
        res = Frame.ICONIFIED;
    } else {
        res = Frame.NORMAL;
    }
    res |= getExtendedState(window);
    return res;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:XWM.java

示例5: changeState

void changeState(int newState) {
    int changed = state ^ newState;
    int changeIconic = changed & Frame.ICONIFIED;
    boolean iconic = (newState & Frame.ICONIFIED) != 0;
    if (stateLog.isLoggable(PlatformLogger.Level.FINER)) {
        stateLog.finer("Changing state, old state {0}, new state {1}(iconic {2})",
                   Integer.valueOf(state), Integer.valueOf(newState), Boolean.valueOf(iconic));
    }
    if (changeIconic != 0 && iconic) {
        if (stateLog.isLoggable(PlatformLogger.Level.FINER)) {
            stateLog.finer("Iconifying shell " + getShell() + ", this " + this + ", screen " + getScreenNumber());
        }
        XToolkit.awtLock();
        try {
            int res = XlibWrapper.XIconifyWindow(XToolkit.getDisplay(), getShell(), getScreenNumber());
            if (stateLog.isLoggable(PlatformLogger.Level.FINER)) {
                stateLog.finer("XIconifyWindow returned " + res);
            }
        }
        finally {
            XToolkit.awtUnlock();
        }
    }
    if ((changed & ~Frame.ICONIFIED) != 0) {
        setExtendedState(newState);
    }
    if (changeIconic != 0 && !iconic) {
        if (stateLog.isLoggable(PlatformLogger.Level.FINER)) {
            stateLog.finer("DeIconifying " + this);
        }

        XNETProtocol net_protocol = XWM.getWM().getNETProtocol();
        if (net_protocol != null) {
            net_protocol.setActiveWindow(this);
        }
        xSetVisible(true);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:38,代码来源:XFramePeer.java

示例6: windowStateChanged

public void windowStateChanged(WindowEvent windowEvent) {
            if (popupWindow != null ) {
                int oldState = windowEvent.getOldState();
                int newState = windowEvent.getNewState();
            
                if (((oldState & Frame.ICONIFIED) == 0) &&
                    ((newState & Frame.ICONIFIED) == Frame.ICONIFIED)) {
                    hidePopup();
//                } else if (((oldState & Frame.ICONIFIED) == Frame.ICONIFIED) && 
//                           ((newState & Frame.ICONIFIED) == 0 )) {
//                    //TODO remember we showed before and show again? I guess not worth the efford, not part of spec.
                }
            }

        }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:PopupUtil.java

示例7: setupState

void setupState(boolean onInit) {
    if (onInit) {
        state = winAttr.initialState;
    }
    if ((state & Frame.ICONIFIED) != 0) {
        setInitialState(XUtilConstants.IconicState);
    } else {
        setInitialState(XUtilConstants.NormalState);
    }
    setExtendedState(state);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:XFramePeer.java

示例8: main

public static void main(String[] args) {
    Frame frame = new Frame("frame");
    frame.setBounds(100, 100, 200, 200);
    frame.setVisible(true);
    frame.setExtendedState(Frame.MAXIMIZED_BOTH);
    frame.setExtendedState(Frame.ICONIFIED);
    if (frame.getExtendedState() != Frame.ICONIFIED) {
        frame.dispose();
        throw new RuntimeException("Test Failed");
    }
    frame.dispose();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:SetExtendedState.java

示例9: windowActivated

/**
 * Method description
 * 
 * @see
 * @param objPwindowEvent
 */
@Override final public void windowActivated(WindowEvent objPwindowEvent) {
	try { // Try, cos the object hasn't been completely initialized.

		// TODO DISPARAITRE, C'est JugglePanel qui cr�e ce Listener pour la Frame (si JP existe).
		if (this.objGjuggleMasterPro.getFrame().getExtendedState() != Frame.ICONIFIED) {
			this.objGjuggleMasterPro.getFrame().bolGdontFocusJuggleMasterPro = true;
			this.objGcontrolJFrame.requestFocus();
		}
	} catch (final Throwable objPthrowable) {
		Tools.err("Error while activating animation window");
	}
}
 
开发者ID:jugglemaster,项目名称:JuggleMasterPro,代码行数:18,代码来源:AnimationJFrame.java

示例10: handlePropertyNotify

public void handlePropertyNotify(XEvent xev) {
    super.handlePropertyNotify(xev);
    XPropertyEvent ev = xev.get_xproperty();

    if (log.isLoggable(PlatformLogger.Level.FINER)) {
        log.finer("Property change {0}", ev);
    }
    /*
     * Let's see if this is a window state protocol message, and
     * if it is - decode a new state in terms of java constants.
     */
    if (!XWM.getWM().isStateChange(this, ev)) {
        stateLog.finer("either not a state atom or state has not been changed");
        return;
    }

    final int newState = XWM.getWM().getState(this);
    int changed = state ^ newState;
    if (changed == 0) {
        if (stateLog.isLoggable(PlatformLogger.Level.FINER)) {
            stateLog.finer("State is the same: " + state);
        }
        return;
    }

    int old_state = state;
    state = newState;

    // sync target with peer
    AWTAccessor.getFrameAccessor().setExtendedState((Frame)target, state);

    if ((changed & Frame.ICONIFIED) != 0) {
        if ((state & Frame.ICONIFIED) != 0) {
            stateLog.finer("Iconified");
            handleIconify();
        } else {
            stateLog.finer("DeIconified");
            content.purgeIconifiedExposeEvents();
            handleDeiconify();
        }
    }
    handleStateChange(old_state, state);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:43,代码来源:XFramePeer.java

示例11: activateModeTopComponent

/** */
public void activateModeTopComponent(ModeImpl mode, TopComponent tc) {
    if(!getModeOpenedTopComponents(mode).contains(tc)) {
        return;
    }
    
    ModeImpl oldActiveMode = getActiveMode();
    //#45650 -some API users call the activation all over again all the time on one item.
    // improve performance for such cases.
    if (oldActiveMode != null && oldActiveMode.equals(mode)) {
        if (tc != null && tc.equals(model.getModeSelectedTopComponent(mode))) {
            // #82385, #139319 do repeat activation if focus is not
            // owned by tc to be activated
            Component fOwn = KeyboardFocusManager.getCurrentKeyboardFocusManager().
                    getFocusOwner();
            if (fOwn != null && SwingUtilities.isDescendingFrom(fOwn, tc)) {
                //#70173 - activation request came probably from a sliding
                //window in 'hover' mode, so let's hide it
                slideOutSlidingWindows( mode );
                return;
            }
        }
    }
    model.setActiveMode(mode);
    model.setModeSelectedTopComponent(mode, tc);
    
    if(isVisible()) {
        viewRequestor.scheduleRequest(new ViewRequest(mode, 
            View.CHANGE_TOPCOMPONENT_ACTIVATED, null, tc));

        //restore floating windows if iconified
        if( mode.getState() == Constants.MODE_STATE_SEPARATED ) {
            Frame frame = (Frame) SwingUtilities.getAncestorOfClass(Frame.class, tc);
            if( null != frame && frame != WindowManagerImpl.getInstance().getMainWindow()
                    && (frame.getExtendedState() & Frame.ICONIFIED) > 0 ) {
                frame.setExtendedState(frame.getExtendedState() - Frame.ICONIFIED );
            }
        }
    }
    
    // Notify registry.
    WindowManagerImpl.notifyRegistryTopComponentActivated(tc);
    
    if(oldActiveMode != mode) {
        WindowManagerImpl.getInstance().doFirePropertyChange(
            WindowManagerImpl.PROP_ACTIVE_MODE, oldActiveMode, mode);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:48,代码来源:Central.java

示例12: isFrameMinimized

static boolean isFrameMinimized(final Frame frame) {
    return (frame.getExtendedState() & Frame.ICONIFIED) != 0;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:3,代码来源:_AppMenuBarHandler.java

示例13: main

public static void main(String[] args) {
    Robot robot = Util.createRobot();

    Frame testFrame = new Frame("Test Frame");
    testFrame.setSize(200, 200);
    testFrame.addWindowStateListener(new WindowStateListener() {
        @Override
        public void windowStateChanged(WindowEvent e) {
            listenerNotified.set(true);
            synchronized (listenerNotified) {
                listenerNotified.notifyAll();
            }
        }
    });
    testFrame.setVisible(true);

    Frame mainFrame = new Frame("Main Frame");
    mainFrame.setSize(200, 200);
    mainFrame.setLocationRelativeTo(null);
    mainFrame.setVisible(true);

    Util.waitForIdle(robot);

    try {
        Util.clickOnComp(mainFrame, robot);
        Util.waitForIdle(robot);

        // NORMAL -> ICONIFIED
        listenerNotified.set(false);
        testFrame.setExtendedState(Frame.ICONIFIED);
        Util.waitForIdle(robot);

        Util.waitForCondition(listenerNotified, 2000);
        if (!listenerNotified.get()) {
            throw new RuntimeException("Test FAILED! Window state listener was not notified during NORMAL to" +
                    "ICONIFIED transition");
        }
        if (testFrame.getExtendedState() != Frame.ICONIFIED) {
            throw new RuntimeException("Test FAILED! Frame is not in ICONIFIED state");
        }

        // ICONIFIED -> NORMAL
        listenerNotified.set(false);
        testFrame.setExtendedState(Frame.NORMAL);
        Util.waitForIdle(robot);

        Util.waitForCondition(listenerNotified, 2000);
        if (!listenerNotified.get()) {
            throw new RuntimeException("Test FAILED! Window state listener was not notified during ICONIFIED to" +
                    "NORMAL transition");
        }
        if (testFrame.getExtendedState() != Frame.NORMAL) {
            throw new RuntimeException("Test FAILED! Frame is not in NORMAL state");
        }
    } finally {
        testFrame.dispose();
        mainFrame.dispose();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:59,代码来源:NormalToIconifiedTest.java


注:本文中的java.awt.Frame.ICONIFIED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。