本文整理匯總了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);
}
}
示例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());
}
}
示例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.
}
}
}
示例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;
}
示例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);
}
}
示例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.
}
}
}
示例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);
}
示例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();
}
示例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");
}
}
示例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);
}
示例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);
}
}
示例12: isFrameMinimized
static boolean isFrameMinimized(final Frame frame) {
return (frame.getExtendedState() & Frame.ICONIFIED) != 0;
}
示例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();
}
}