當前位置: 首頁>>代碼示例>>Java>>正文


Java Frame.NORMAL屬性代碼示例

本文整理匯總了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();
    }
}
 
開發者ID:buni-rock,項目名稱:Pixie,代碼行數:38,代碼來源:GUILabelingTool.java

示例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();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:DefaultModel.java

示例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;
        }
    }
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:18,代碼來源:XWM.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:SunburstApps,項目名稱:OpenJSharp,代碼行數:11,代碼來源:XWM.java

示例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;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:14,代碼來源:XNETProtocol.java

示例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();
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:59,代碼來源:NormalToIconifiedTest.java


注:本文中的java.awt.Frame.NORMAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。