本文整理汇总了Java中java.awt.Frame.NORMAL属性的典型用法代码示例。如果您正苦于以下问题:Java Frame.NORMAL属性的具体用法?Java Frame.NORMAL怎么用?Java Frame.NORMAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.Frame
的用法示例。
在下文中一共展示了Frame.NORMAL属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: adjustWindowDimensions
/**
* Adjust the size of the screen and its components in such way as to have
* them all fitting to the screen.
*
* @param windowState the state of the window:<br>
* <ul>
* <li><code>NORMAL</code>
* <br>Indicates that no state bits are set.
* <li><code>ICONIFIED</code>
* <li><code>MAXIMIZED_HORIZ</code>
* <li><code>MAXIMIZED_VERT</code>
* <li><code>MAXIMIZED_BOTH</code> - Concatenates
* <code>MAXIMIZED_HORIZ</code> and <code>MAXIMIZED_VERT</code>.
* </ul>
*/
private void adjustWindowDimensions(int windowState, Dimension usedResolution) {
// do not change anything if the application is in iconified state
if (windowState == Frame.ICONIFIED) {
return;
}
// when the drawing panel is valid, compute the
if (gc.getdPImgToLabel() != null) {
// compute the drawing size based on the gui components
gc.setAvailableDrawSize(computeDrawingSize(usedResolution));
// refresh the drawing panel and its image
gc.refreshImage();
// rearrange the view panel, to fit the new drawing panel size
redrawViewPanel();
}
if (windowState == Frame.NORMAL) {
// if the window is not maximized, pack the window and set a new min size
packGUI();
}
}
示例2: reset
@Override
public void reset() {
mode2model.clear();
group2model.clear();
mainWindowFrameStateJoined = Frame.NORMAL;
mainWindowFrameStateSeparated = Frame.NORMAL;
editorAreaState = Constants.EDITOR_AREA_JOINED;
editorAreaFrameState = Frame.NORMAL;
toolbarConfigName = "Standard"; // NOI18N
modesSubModel = new ModesSubModel(this);
topComponentGroups.clear();
maximizedDockingStatus.clear();
defaultDockingStatus.clear();
slideInMaximizedTopComponents.clear();
}
示例3: getExtendedState
/*****************************************************************************\
*
* Reading state from different protocols
*
\*****************************************************************************/
int getExtendedState(XWindowPeer window) {
int state = 0;
for (XStateProtocol proto : getProtocols(XStateProtocol.class)) {
state |= proto.getState(window);
}
if (state != 0) {
return state;
} else {
return Frame.NORMAL;
}
}
示例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: getStateImpl
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;
}
示例6: 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();
}
}