當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。