Example usage for java.awt Frame MAXIMIZED_BOTH

List of usage examples for java.awt Frame MAXIMIZED_BOTH

Introduction

In this page you can find the example usage for java.awt Frame MAXIMIZED_BOTH.

Prototype

int MAXIMIZED_BOTH

To view the source code for java.awt Frame MAXIMIZED_BOTH.

Click Source Link

Document

This state bit mask indicates that frame is fully maximized (that is both horizontally and vertically).

Usage

From source file:kieker.tools.KaxViz.java

@Override
protected boolean performTask() {
    try {/*www.j a  va 2s . c  om*/
        final KaxVizFrame frame = new KaxVizFrame(this.kaxFilename,
                AnalysisController.loadFromFile(new File(this.kaxFilename)), this.svgFilename);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setExtendedState(Frame.MAXIMIZED_BOTH);
        frame.setSize(800, 600);
        frame.setVisible(true);
    } catch (final IOException ex) {
        LOG.error("The given file could not be loaded", ex);
        return false;
    } catch (final Exception ex) { // NOPMD NOCS (log all errors)
        LOG.error("Error", ex);
        return false;
    }
    return true;
}

From source file:WindowEventDemo.java

public void checkWM() {
    Toolkit tk = frame.getToolkit();
    if (!(tk.isFrameStateSupported(Frame.ICONIFIED))) {
        displayMessage("Your window manager doesn't support ICONIFIED.");
    } else// ww w . j  a va  2  s.c o m
        displayMessage("Your window manager supports ICONIFIED.");
    if (!(tk.isFrameStateSupported(Frame.MAXIMIZED_VERT))) {
        displayMessage("Your window manager doesn't support MAXIMIZED_VERT.");
    } else
        displayMessage("Your window manager supports MAXIMIZED_VERT.");
    if (!(tk.isFrameStateSupported(Frame.MAXIMIZED_HORIZ))) {
        displayMessage("Your window manager doesn't support MAXIMIZED_HORIZ.");
    } else
        displayMessage("Your window manager supports MAXIMIZED_HORIZ.");
    if (!(tk.isFrameStateSupported(Frame.MAXIMIZED_BOTH))) {
        displayMessage("Your window manager doesn't support MAXIMIZED_BOTH.");
    } else {
        displayMessage("Your window manager supports MAXIMIZED_BOTH.");
    }
}

From source file:org.ash.gui.MainFrame.java

/**
 * Instantiates a new main frame.//from w ww  . j ava  2 s  .c  o  m
 */
public MainFrame() {
    super();
    Options.getInstance().setDateFormat("dd.MM.yyyy hh:mm:ss");
    Options.getInstance().setLanguage(Locale.getDefault().getLanguage());
    Options.getInstance().setJtextAreaSqlTextGanttHAndDetailsH();

    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    this.setSize((int) screenSize.getWidth(), (int) screenSize.getHeight() - 24);
    this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    JFrame.setDefaultLookAndFeelDecorated(true);

    this.setExtendedState(this.getExtendedState() | Frame.MAXIMIZED_BOTH);

    // retrieve the HashMap of Default properties.  
    //UIDefaults uiDefs = UIManager.getDefaults();

    // Set indent for SQL plan JTreeTable.  
    //uiDefs.put("Tree.leftChildIndent" , new Integer( 1 ) ); 
    //uiDefs.put("Tree.rightChildIndent" , new Integer( 8 ) );  

    try {
        jbInit();
        menuFileNewConn_actionPerformed(null);

    } catch (Exception e) {
        e.printStackTrace();
    }

}

From source file:net.pms.newgui.components.WindowProperties.java

/**
 * Creates a new instance using the specified parameters.
 *
 * @param window the {@link Window} whose properties to keep track of.
 * @param standardSize the standard size of {@code window}.
 * @param mimimumSize the minimum size of {@code window}.
 * @param windowConfiguration the {@link WindowPropertiesConfiguration}
 *            instance for reading and writing the window properties.
 *///www . j  a v  a2  s.  c  om
public WindowProperties(@Nonnull Window window, @Nullable Dimension standardSize,
        @Nullable Dimension mimimumSize, @Nullable WindowPropertiesConfiguration windowConfiguration) {
    if (window == null) {
        throw new IllegalArgumentException("window cannot be null");
    }
    this.window = window;
    this.minimumSize = mimimumSize;
    if (mimimumSize != null) {
        window.setMinimumSize(mimimumSize);
    }
    this.windowConfiguration = windowConfiguration;
    if (windowConfiguration != null) {
        getConfiguration();
        GraphicsConfiguration windowGraphicsConfiguration = window.getGraphicsConfiguration();
        if (windowBounds != null && effectiveScreenBounds != null && graphicsDevice != null
                && graphicsDevice.equals(windowGraphicsConfiguration.getDevice().getIDstring())
                && screenBounds != null && screenBounds.equals(windowGraphicsConfiguration.getBounds())) {
            setWindowBounds();
        } else {
            Rectangle screen = effectiveScreenBounds != null ? effectiveScreenBounds
                    : windowGraphicsConfiguration.getBounds();
            if (standardSize != null && screen.width >= standardSize.width
                    && screen.height >= standardSize.height) {
                window.setSize(standardSize);
            } else if (mimimumSize != null && (window.getWidth() < mimimumSize.width
                    || window.getHeight() < mimimumSize.getHeight())) {
                window.setSize(mimimumSize);
            }
            window.setLocationByPlatform(true);
        }
        if (window instanceof Frame) {
            // Set maximized state
            int maximizedState = windowState & Frame.MAXIMIZED_BOTH;
            if (maximizedState != 0) {
                ((Frame) window).setExtendedState(((Frame) window).getExtendedState() | maximizedState);
            }
        }
    }
    window.addWindowListener(this);
    window.addComponentListener(this);
}

From source file:org.f2o.absurdum.puck.gui.PuckFrame.java

/**
 * Maximizes this frame if supported by the platform.
 *//*from w w  w.  jav  a  2 s .c  om*/
private void maximizeIfPossible() {
    int state = getExtendedState();
    state |= Frame.MAXIMIZED_BOTH;
    setExtendedState(state);
}

From source file:jamel.gui.JamelWindow.java

/**
 * /*  ww  w. j  av  a  2  s .  co  m*/
 */
public JamelWindow() {
    viewManager = new ViewManager();
    tabbedPane = new JTabbedPane();
    setVisible(false);
    setMinimumSize(new Dimension(400, 200));
    setPreferredSize(new Dimension(800, 400));
    pack();
    setExtendedState(Frame.MAXIMIZED_BOTH);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    // ********
    getContentPane().add(tabbedPane);
    this.tabbedPane.add("Main", getMainPanel());
    this.tabbedPane.add("Industry", getIndustryPanel());
    this.tabbedPane.add("Labor", getLaborPanel());
    this.tabbedPane.add("Money", getMoneyPanel());
    this.tabbedPane.add("Matrix", getMatrixPanel());
    this.tabbedPane.add("Console", getConsolePanel());
    this.tabbedPane.add("Info", getInfoPanel());
    this.buttonBar = new ButtonBar(this);
    getContentPane().add(this.buttonBar, "South");
    this.buttonBar.pause(false);
}

From source file:org.parosproxy.paros.Andiparos.java

private void runGUI() throws ClassNotFoundException, Exception {

    Control.initSingletonWithView();
    Control control = Control.getSingleton();
    View view = View.getSingleton();
    view.postInit();//from   w ww .j a  va2s.  c om
    view.getMainFrame().setExtendedState(Frame.MAXIMIZED_BOTH);
    view.getMainFrame().setVisible(true);
    view.setStatus("");

    control.getMenuFileControl().newSession(false);

}

From source file:WindowEventDemo.java

String convertStateToString(int state) {
    if (state == Frame.NORMAL) {
        return "NORMAL";
    }//from  w  w w  .  j  av  a  2s  .  c  o m
    if ((state & Frame.ICONIFIED) != 0) {
        return "ICONIFIED";
    }
    //MAXIMIZED_BOTH is a concatenation of two bits, so
    //we need to test for an exact match.
    if ((state & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH) {
        return "MAXIMIZED_BOTH";
    }
    if ((state & Frame.MAXIMIZED_VERT) != 0) {
        return "MAXIMIZED_VERT";
    }
    if ((state & Frame.MAXIMIZED_HORIZ) != 0) {
        return "MAXIMIZED_HORIZ";
    }
    return "UNKNOWN";
}

From source file:org.pmedv.core.gui.ApplicationWindowAdvisorImpl.java

@Override
public void postWindowCreate() {

    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
    Rectangle frame = win.getBounds();

    ApplicationWindowConfiguration config = windowConfig.getConfig();

    if (config.getX() > 0 && config.getY() > 0) {
        win.setLocation(config.getX(), config.getY());
    } else {//from   w  w  w . j  a  va  2  s.  c om
        win.setLocation((screen.width - frame.width) / 2, (screen.height - frame.height) / 2);
        Rectangle bounds = new Rectangle(0, 0, screen.width, screen.height - 35);
        win.setBounds(bounds);
    }
    if (config.getHeight() > 0 && config.getWidth() > 0) {
        if (config.isMaximized())
            win.setExtendedState(win.getExtendedState() | Frame.MAXIMIZED_BOTH);
        else
            win.setSize(config.getWidth(), config.getHeight());
    } else {
        GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
        numberOfDisplays = env.getScreenDevices().length;
        win.setMaximizedBounds(env.getMaximumWindowBounds());
        win.setExtendedState(win.getExtendedState() | Frame.MAXIMIZED_BOTH);
    }
    //      if (!config.isStatusbarVisible())
    //         win.getStatusBar().setVisible(false);

}