2 * Instantlauncher. Copyright ©2012-2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public License
6 * or later as published by the Free Software Foundation.
9 package eu.svjatoslav.instantlauncher;
11 import eu.svjatoslav.instantlauncher.menu.MultiLevelMenu;
15 import java.awt.event.WindowEvent;
16 import java.awt.event.WindowListener;
20 private final InstantLauncher instantLauncher;
22 private boolean isShowing;
24 public MainFrame(final InstantLauncher instantLauncher) {
25 this.instantLauncher = instantLauncher;
28 private void buildContentPane() {
30 final MultiLevelMenu multiLevelMenu = new MultiLevelMenu(instantLauncher);
31 frame.getContentPane().add(multiLevelMenu.buildContentPanel(), BorderLayout.CENTER);
39 frame = new JFrame("InstantLauncher");
43 // registor window listener
44 final FrameWindowListener windowListener = new FrameWindowListener();
45 frame.addWindowListener(windowListener);
48 frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
49 frame.setVisible(true);
56 private static class FrameWindowListener implements WindowListener {
59 public void windowActivated(final WindowEvent e) {
63 public void windowClosed(final WindowEvent e) {
67 public void windowClosing(final WindowEvent e) {
68 InstantLauncher.exitProgram();
72 public void windowDeactivated(final WindowEvent e) {
76 public void windowDeiconified(final WindowEvent e) {
80 public void windowIconified(final WindowEvent e) {
84 public void windowOpened(final WindowEvent e) {