当前位置: 首页>>代码示例>>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;未经允许,请勿转载。