Java Code Examples for java.awt.Frame#MAXIMIZED_VERT
The following examples show how to use
java.awt.Frame#MAXIMIZED_VERT .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XNETProtocol.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private void setInitialState(XWindowPeer window, int state) { XAtomList old_state = window.getNETWMState(); if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Current state of the window {0} is {1}", window, old_state); } if ((state & Frame.MAXIMIZED_VERT) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_VERT); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_VERT); } if ((state & Frame.MAXIMIZED_HORIZ) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_HORZ); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ); } if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting initial state of the window {0} to {1}", window, old_state); } window.setNETWMState(old_state); }
Example 2
Source File: XWM.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * Check if state is supported. * Note that a compound state is always reported as not supported. * Note also that MAXIMIZED_BOTH is considered not a compound state. * Therefore, a compound state is just ICONIFIED | anything else. * */ boolean supportsExtendedState(int state) { switch (state) { case Frame.MAXIMIZED_VERT: case Frame.MAXIMIZED_HORIZ: /* * WMs that talk NET/WIN protocol, but do not support * unidirectional maximization. */ if (getWMID() == METACITY_WM) { /* "This is a deliberate policy decision." -hp */ return false; } /* FALLTROUGH */ case Frame.MAXIMIZED_BOTH: for (XStateProtocol proto : getProtocols(XStateProtocol.class)) { if (proto.supportsState(state)) { return true; } } default: return false; } }
Example 3
Source File: XNETProtocol.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
private void setInitialState(XWindowPeer window, int state) { XAtomList old_state = window.getNETWMState(); if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Current state of the window {0} is {1}", window, old_state); } if ((state & Frame.MAXIMIZED_VERT) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_VERT); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_VERT); } if ((state & Frame.MAXIMIZED_HORIZ) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_HORZ); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ); } if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting initial state of the window {0} to {1}", window, old_state); } window.setNETWMState(old_state); }
Example 4
Source File: XNETProtocol.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private void setInitialState(XWindowPeer window, int state) { XAtomList old_state = window.getNETWMState(); if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Current state of the window {0} is {1}", window, old_state); } if ((state & Frame.MAXIMIZED_VERT) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_VERT); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_VERT); } if ((state & Frame.MAXIMIZED_HORIZ) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_HORZ); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ); } if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting initial state of the window {0} to {1}", window, old_state); } window.setNETWMState(old_state); }
Example 5
Source File: XNETProtocol.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private void setInitialState(XWindowPeer window, int state) { XAtomList old_state = window.getNETWMState(); if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Current state of the window {0} is {1}", window, old_state); } if ((state & Frame.MAXIMIZED_VERT) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_VERT); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_VERT); } if ((state & Frame.MAXIMIZED_HORIZ) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_HORZ); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ); } if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting initial state of the window {0} to {1}", window, old_state); } window.setNETWMState(old_state); }
Example 6
Source File: XWM.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * Check if state is supported. * Note that a compound state is always reported as not supported. * Note also that MAXIMIZED_BOTH is considered not a compound state. * Therefore, a compound state is just ICONIFIED | anything else. * */ boolean supportsExtendedState(int state) { switch (state) { case Frame.MAXIMIZED_VERT: case Frame.MAXIMIZED_HORIZ: /* * WMs that talk NET/WIN protocol, but do not support * unidirectional maximization. */ if (getWMID() == METACITY_WM) { /* "This is a deliberate policy decision." -hp */ return false; } /* FALLTROUGH */ case Frame.MAXIMIZED_BOTH: for (XStateProtocol proto : getProtocols(XStateProtocol.class)) { if (proto.supportsState(state)) { return true; } } default: return false; } }
Example 7
Source File: XNETProtocol.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private void setInitialState(XWindowPeer window, int state) { XAtomList old_state = window.getNETWMState(); if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Current state of the window {0} is {1}", window, old_state); } if ((state & Frame.MAXIMIZED_VERT) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_VERT); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_VERT); } if ((state & Frame.MAXIMIZED_HORIZ) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_HORZ); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ); } if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting initial state of the window {0} to {1}", window, old_state); } window.setNETWMState(old_state); }
Example 8
Source File: XNETProtocol.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private void setInitialState(XWindowPeer window, int state) { XAtomList old_state = window.getNETWMState(); if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Current state of the window {0} is {1}", window, old_state); } if ((state & Frame.MAXIMIZED_VERT) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_VERT); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_VERT); } if ((state & Frame.MAXIMIZED_HORIZ) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_HORZ); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ); } if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting initial state of the window {0} to {1}", window, old_state); } window.setNETWMState(old_state); }
Example 9
Source File: XWM.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Check if state is supported. * Note that a compound state is always reported as not supported. * Note also that MAXIMIZED_BOTH is considered not a compound state. * Therefore, a compound state is just ICONIFIED | anything else. * */ boolean supportsExtendedState(int state) { switch (state) { case Frame.MAXIMIZED_VERT: case Frame.MAXIMIZED_HORIZ: /* * WMs that talk NET/WIN protocol, but do not support * unidirectional maximization. */ if (getWMID() == METACITY_WM) { /* "This is a deliberate policy decision." -hp */ return false; } /* FALLTROUGH */ case Frame.MAXIMIZED_BOTH: for (XStateProtocol proto : getProtocols(XStateProtocol.class)) { if (proto.supportsState(state)) { return true; } } default: return false; } }
Example 10
Source File: XNETProtocol.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
private void setInitialState(XWindowPeer window, int state) { XAtomList old_state = window.getNETWMState(); if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Current state of the window {0} is {1}", window, old_state); } if ((state & Frame.MAXIMIZED_VERT) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_VERT); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_VERT); } if ((state & Frame.MAXIMIZED_HORIZ) != 0) { old_state.add(XA_NET_WM_STATE_MAXIMIZED_HORZ); } else { old_state.remove(XA_NET_WM_STATE_MAXIMIZED_HORZ); } if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Setting initial state of the window {0} to {1}", window, old_state); } window.setNETWMState(old_state); }
Example 11
Source File: XWM.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
/** * Check if state is supported. * Note that a compound state is always reported as not supported. * Note also that MAXIMIZED_BOTH is considered not a compound state. * Therefore, a compound state is just ICONIFIED | anything else. * */ boolean supportsExtendedState(int state) { switch (state) { case Frame.MAXIMIZED_VERT: case Frame.MAXIMIZED_HORIZ: /* * WMs that talk NET/WIN protocol, but do not support * unidirectional maximization. */ if (getWMID() == METACITY_WM) { /* "This is a deliberate policy decision." -hp */ return false; } /* FALLTROUGH */ case Frame.MAXIMIZED_BOTH: for (XStateProtocol proto : getProtocols(XStateProtocol.class)) { if (proto.supportsState(state)) { return true; } } default: return false; } }
Example 12
Source File: XNETProtocol.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
int getStateImpl(XWindowPeer window) { XAtomList net_wm_state = window.getNETWMState(); if (net_wm_state.size() == 0) { return Frame.NORMAL; } int java_state = Frame.NORMAL; if (net_wm_state.contains(XA_NET_WM_STATE_MAXIMIZED_VERT)) { java_state |= Frame.MAXIMIZED_VERT; } if (net_wm_state.contains(XA_NET_WM_STATE_MAXIMIZED_HORZ)) { java_state |= Frame.MAXIMIZED_HORIZ; } return java_state; }
Example 13
Source File: XNETProtocol.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
int getStateImpl(XWindowPeer window) { XAtomList net_wm_state = window.getNETWMState(); if (net_wm_state.size() == 0) { return Frame.NORMAL; } int java_state = Frame.NORMAL; if (net_wm_state.contains(XA_NET_WM_STATE_MAXIMIZED_VERT)) { java_state |= Frame.MAXIMIZED_VERT; } if (net_wm_state.contains(XA_NET_WM_STATE_MAXIMIZED_HORZ)) { java_state |= Frame.MAXIMIZED_HORIZ; } return java_state; }
Example 14
Source File: XNETProtocol.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
int getStateImpl(XWindowPeer window) { XAtomList net_wm_state = window.getNETWMState(); if (net_wm_state.size() == 0) { return Frame.NORMAL; } int java_state = Frame.NORMAL; if (net_wm_state.contains(XA_NET_WM_STATE_MAXIMIZED_VERT)) { java_state |= Frame.MAXIMIZED_VERT; } if (net_wm_state.contains(XA_NET_WM_STATE_MAXIMIZED_HORZ)) { java_state |= Frame.MAXIMIZED_HORIZ; } return java_state; }
Example 15
Source File: XNETProtocol.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
private void requestState(XWindowPeer window, int state) { /* * We have to use toggle for maximization because of transitions * from maximization in one direction only to maximization in the * other direction only. */ int old_net_state = getState(window); int max_changed = (state ^ old_net_state) & (Frame.MAXIMIZED_BOTH); XClientMessageEvent req = new XClientMessageEvent(); try { switch(max_changed) { case 0: return; case Frame.MAXIMIZED_HORIZ: req.set_data(1, XA_NET_WM_STATE_MAXIMIZED_HORZ.getAtom()); req.set_data(2, 0); break; case Frame.MAXIMIZED_VERT: req.set_data(1, XA_NET_WM_STATE_MAXIMIZED_VERT.getAtom()); req.set_data(2, 0); break; case Frame.MAXIMIZED_BOTH: req.set_data(1, XA_NET_WM_STATE_MAXIMIZED_HORZ.getAtom()); req.set_data(2, XA_NET_WM_STATE_MAXIMIZED_VERT.getAtom()); break; default: return; } if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Requesting state on " + window + " for " + state); } req.set_type((int)XConstants.ClientMessage); req.set_window(window.getWindow()); req.set_message_type(XA_NET_WM_STATE.getAtom()); req.set_format(32); req.set_data(0, _NET_WM_STATE_TOGGLE); XToolkit.awtLock(); try { XlibWrapper.XSendEvent(XToolkit.getDisplay(), XlibWrapper.RootWindow(XToolkit.getDisplay(), window.getScreenNumber()), false, XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask, req.pData); } finally { XToolkit.awtUnlock(); } } finally { req.dispose(); } }
Example 16
Source File: XFramePeer.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
boolean isMaximized() { return (state & (Frame.MAXIMIZED_VERT | Frame.MAXIMIZED_HORIZ)) != 0; }
Example 17
Source File: XFramePeer.java From hottub with GNU General Public License v2.0 | 4 votes |
boolean isMaximized() { return (state & (Frame.MAXIMIZED_VERT | Frame.MAXIMIZED_HORIZ)) != 0; }
Example 18
Source File: XNETProtocol.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
private void requestState(XWindowPeer window, int state) { /* * We have to use toggle for maximization because of transitions * from maximization in one direction only to maximization in the * other direction only. */ int old_net_state = getState(window); int max_changed = (state ^ old_net_state) & (Frame.MAXIMIZED_BOTH); XClientMessageEvent req = new XClientMessageEvent(); try { switch(max_changed) { case 0: return; case Frame.MAXIMIZED_HORIZ: req.set_data(1, XA_NET_WM_STATE_MAXIMIZED_HORZ.getAtom()); req.set_data(2, 0); break; case Frame.MAXIMIZED_VERT: req.set_data(1, XA_NET_WM_STATE_MAXIMIZED_VERT.getAtom()); req.set_data(2, 0); break; case Frame.MAXIMIZED_BOTH: req.set_data(1, XA_NET_WM_STATE_MAXIMIZED_HORZ.getAtom()); req.set_data(2, XA_NET_WM_STATE_MAXIMIZED_VERT.getAtom()); break; default: return; } if (log.isLoggable(PlatformLogger.Level.FINE)) { log.fine("Requesting state on " + window + " for " + state); } req.set_type((int)XConstants.ClientMessage); req.set_window(window.getWindow()); req.set_message_type(XA_NET_WM_STATE.getAtom()); req.set_format(32); req.set_data(0, _NET_WM_STATE_TOGGLE); XToolkit.awtLock(); try { XlibWrapper.XSendEvent(XToolkit.getDisplay(), XlibWrapper.RootWindow(XToolkit.getDisplay(), window.getScreenNumber()), false, XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask, req.pData); } finally { XToolkit.awtUnlock(); } } finally { req.dispose(); } }
Example 19
Source File: XFramePeer.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
boolean isMaximized() { return (state & (Frame.MAXIMIZED_VERT | Frame.MAXIMIZED_HORIZ)) != 0; }
Example 20
Source File: XFramePeer.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
boolean isMaximized() { return (state & (Frame.MAXIMIZED_VERT | Frame.MAXIMIZED_HORIZ)) != 0; }