public static void layoutInit() {
        Dimension dimension = new Dimension(560, 320);
        if (OperatingSystem.getCurrent() == OperatingSystem.MACOS) {
            dimension.setSize(dimension.getWidth() * PopupBase.MACOS_WIDTH_SCALE, dimension.getHeight());
        }
        FRAME.setPreferredSize(dimension);
        LOG_BTN.addActionListener((e) -> {
            if (!PopupBase.isAlive(LogFrame.class)) {
                new LogFrame();
            } else {
                PopupBase.getAlive(LogFrame.class).reopen();
            }
        });
        JS_BTN.addActionListener((e) -> {
            MainJDEC.IS_ENABLED.setSelected(false);
            MainJDEC.IS_ENABLED.setEnabled(false);
            if (!PopupBase.isAlive(JoystickFrame.class)) {
                new JoystickFrame();
            } else {
                PopupBase.getAlive(JoystickFrame.class).reopen();
            }
        });
        STATS_BTN.addActionListener((e) -> {
            if (!PopupBase.isAlive(StatsFrame.class)) {
                new StatsFrame();
            } else {
                PopupBase.getAlive(StatsFrame.class).reopen();
            }
        });
        NT_BTN.addActionListener((e) -> {
            if (!PopupBase.isAlive(NTFrame.class)) {
                NT_FRAME = new NTFrame();
            } else {
                PopupBase.getAlive(NTFrame.class).reopen();
            }
        });
        USB_CONNECT.addActionListener((e) -> {
            Thread reload = new Thread() {
                @Override
                public void run() {
                    NetworkReloader.reloadRio(Protocol.UDP);
                    NetworkReloader.reloadRio(Protocol.TCP);
                    super.run();
                    interrupt();
                }
            };
            reload.start();
        });
        RESTART_CODE_BTN.addActionListener(e -> IS_ENABLED.setSelected(false));
        //TODO remove after testing
        TEAM_NUMBER.setText("localhost");
        TEAM_NUMBER.getDocument().addDocumentListener(new TeamNumListener());
        IS_ENABLED.setEnabled(false);
        GlobalScreen.addNativeKeyListener(GlobalKeyListener.INSTANCE
                .addKeyEvent(NativeKeyEvent.VC_ENTER, () -> MainJDEC.IS_ENABLED.setSelected(false))
                .addKeyEvent(NativeKeyEvent.VC_SPACE, MainJDEC.ESTOP_BTN::doClick));
        GBCPanelBuilder endr = base.clone().setAnchor(GridBagConstraints.LINE_END).setFill(GridBagConstraints.NONE);
        base.clone().setPos(0, 0, 6, 1).setFill(GridBagConstraints.NONE).build(TITLE);
        base.clone().setPos(0, 1, 6, 1).setFill(GridBagConstraints.NONE).build(LINK);
        base.clone().setPos(5, 0, 1, 2).setFill(GridBagConstraints.NONE).build(new JLabel(new ImageIcon(MainFrame.ICON_MIN)));
        base.clone().setPos(0, 2, 1, 1).build(IS_ENABLED);
        base.clone().setPos(1, 2, 1, 1).build(ROBOT_DRIVE_MODE);
        base.clone().setPos(0, 3, 2, 1).setFill(GridBagConstraints.NONE).build(new JLabel("Alliance Station"));
        base.clone().setPos(0, 4, 1, 1).build(ALLIANCE_NUM);
        base.clone().setPos(1, 4, 1, 1).build(ALLIANCE_COLOR);
        endr.clone().setPos(0, 5, 1, 1).build(new JLabel("Team Number:"));
        base.clone().setPos(1, 5, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(TEAM_NUMBER);
        endr.clone().setPos(0, 6, 1, 1).build(new JLabel("Game Data:"));
        base.clone().setPos(1, 6, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(GAME_DATA);
        endr.clone().setPos(0, 7, 1, 1).build(new JLabel("Protocol Year:"));
        base.clone().setPos(1, 7, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(PROTOCOL_YEAR);
        base.clone().setPos(2, 2, 2, 1).build(RESTART_CODE_BTN);
        base.clone().setPos(2, 3, 2, 1).build(RESTART_ROBO_RIO_BTN);
        base.clone().setPos(2, 4, 2, 1).build(ESTOP_BTN);
        base.clone().setPos(2, 5, 1, 1).build(JS_BTN);
        base.clone().setPos(3, 5, 1, 1).build(STATS_BTN);
        base.clone().setPos(2, 6, 1, 1).build(NT_BTN);
        base.clone().setPos(3, 6, 1, 1).build(LOG_BTN);
        base.clone().setPos(2, 7, 1, 1).build(FMS_CONNECT);
        base.clone().setPos(3, 7, 1, 1).build(USB_CONNECT);
        base.clone().setPos(4, 2, 2, 1).setFill(GridBagConstraints.NONE).build(BAT_VOLTAGE);
        endr.clone().setPos(4, 3, 1, 1).build(new JLabel("Robot:"));
        base.clone().setPos(5, 3, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(ROBOT_CONNECTION_STATUS);
        endr.clone().setPos(4, 4, 1, 1).build(new JLabel("Code: "));
        base.clone().setPos(5, 4, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(ROBOT_CODE_STATUS);
        endr.clone().setPos(4, 5, 1, 1).build(new JLabel("EStop: "));
        base.clone().setPos(5, 5, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(ESTOP_STATUS);
        endr.clone().setPos(4, 6, 1, 1).build(new JLabel("FMS: "));
        base.clone().setPos(5, 6, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(FMS_CONNECTION_STATUS);
        endr.clone().setPos(4, 7, 1, 1).build(new JLabel("Time: "));
        base.clone().setPos(5, 7, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(MATCH_TIME);
    }
public static void layoutInit() {
        Dimension dimension = new Dimension(560, 320);
        if (OperatingSystem.getCurrent() == OperatingSystem.MACOS) {
            dimension.setSize(dimension.getWidth() * PopupBase.MACOS_WIDTH_SCALE, dimension.getHeight());
        }
        FRAME.setPreferredSize(dimension);
        LOG_BTN.addActionListener((e) -> {
            if (!PopupBase.isAlive(LogFrame.class)) {
                new LogFrame();
            } else {
                PopupBase.getAlive(LogFrame.class).reopen();
            }
        });
        JS_BTN.addActionListener((e) -> {
            MainJDEC.IS_ENABLED.setSelected(false);
            MainJDEC.IS_ENABLED.setEnabled(false);
            if (!PopupBase.isAlive(JoystickFrame.class)) {
                new JoystickFrame();
            } else {
                PopupBase.getAlive(JoystickFrame.class).reopen();
            }
        });
        STATS_BTN.addActionListener((e) -> {
            if (!PopupBase.isAlive(StatsFrame.class)) {
                new StatsFrame();
            } else {
                PopupBase.getAlive(StatsFrame.class).reopen();
            }
        });
        NT_BTN.addActionListener((e) -> {
            if (!PopupBase.isAlive(NTFrame.class)) {
                NT_FRAME = new NTFrame();
            } else {
                PopupBase.getAlive(NTFrame.class).reopen();
            }
        });
        USB_CONNECT.addActionListener((e) -> {
            Thread reload = new Thread() {
                @Override
                public void run() {
                    NetworkReloader.reloadRio(Protocol.UDP);
                    NetworkReloader.reloadRio(Protocol.TCP);
                    super.run();
                    interrupt();
                }
            };
            reload.start();
        });
        RESTART_CODE_BTN.addActionListener(e -> IS_ENABLED.setSelected(false));
       
        TEAM_NUMBER.setText("localhost");
        TEAM_NUMBER.getDocument().addDocumentListener(new TeamNumListener());
        IS_ENABLED.setEnabled(false);
        GlobalScreen.addNativeKeyListener(GlobalKeyListener.INSTANCE
                .addKeyEvent(NativeKeyEvent.VC_ENTER, () -> MainJDEC.IS_ENABLED.setSelected(false))
                .addKeyEvent(NativeKeyEvent.VC_SPACE, MainJDEC.ESTOP_BTN::doClick));
        GBCPanelBuilder endr = base.clone().setAnchor(GridBagConstraints.LINE_END).setFill(GridBagConstraints.NONE);
        base.clone().setPos(0, 0, 6, 1).setFill(GridBagConstraints.NONE).build(TITLE);
        base.clone().setPos(0, 1, 6, 1).setFill(GridBagConstraints.NONE).build(LINK);
        base.clone().setPos(5, 0, 1, 2).setFill(GridBagConstraints.NONE).build(new JLabel(new ImageIcon(MainFrame.ICON_MIN)));
        base.clone().setPos(0, 2, 1, 1).build(IS_ENABLED);
        base.clone().setPos(1, 2, 1, 1).build(ROBOT_DRIVE_MODE);
        base.clone().setPos(0, 3, 2, 1).setFill(GridBagConstraints.NONE).build(new JLabel("Alliance Station"));
        base.clone().setPos(0, 4, 1, 1).build(ALLIANCE_NUM);
        base.clone().setPos(1, 4, 1, 1).build(ALLIANCE_COLOR);
        endr.clone().setPos(0, 5, 1, 1).build(new JLabel("Team Number:"));
        base.clone().setPos(1, 5, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(TEAM_NUMBER);
        endr.clone().setPos(0, 6, 1, 1).build(new JLabel("Game Data:"));
        base.clone().setPos(1, 6, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(GAME_DATA);
        endr.clone().setPos(0, 7, 1, 1).build(new JLabel("Protocol Year:"));
        base.clone().setPos(1, 7, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(PROTOCOL_YEAR);
        base.clone().setPos(2, 2, 2, 1).build(RESTART_CODE_BTN);
        base.clone().setPos(2, 3, 2, 1).build(RESTART_ROBO_RIO_BTN);
        base.clone().setPos(2, 4, 2, 1).build(ESTOP_BTN);
        base.clone().setPos(2, 5, 1, 1).build(JS_BTN);
        base.clone().setPos(3, 5, 1, 1).build(STATS_BTN);
        base.clone().setPos(2, 6, 1, 1).build(NT_BTN);
        base.clone().setPos(3, 6, 1, 1).build(LOG_BTN);
        base.clone().setPos(2, 7, 1, 1).build(FMS_CONNECT);
        base.clone().setPos(3, 7, 1, 1).build(USB_CONNECT);
        base.clone().setPos(4, 2, 2, 1).setFill(GridBagConstraints.NONE).build(BAT_VOLTAGE);
        endr.clone().setPos(4, 3, 1, 1).build(new JLabel("Robot:"));
        base.clone().setPos(5, 3, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(ROBOT_CONNECTION_STATUS);
        endr.clone().setPos(4, 4, 1, 1).build(new JLabel("Code: "));
        base.clone().setPos(5, 4, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(ROBOT_CODE_STATUS);
        endr.clone().setPos(4, 5, 1, 1).build(new JLabel("EStop: "));
        base.clone().setPos(5, 5, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(ESTOP_STATUS);
        endr.clone().setPos(4, 6, 1, 1).build(new JLabel("FMS: "));
        base.clone().setPos(5, 6, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(FMS_CONNECTION_STATUS);
        endr.clone().setPos(4, 7, 1, 1).build(new JLabel("Time: "));
        base.clone().setPos(5, 7, 1, 1).setAnchor(GridBagConstraints.LINE_START).build(MATCH_TIME);
    }
public static void layoutinit() { dimension dimension = new dimension(560, 320); if (operatingsystem.getcurrent() == operatingsystem.macos) { dimension.setsize(dimension.getwidth() * popupbase.macos_width_scale, dimension.getheight()); } frame.setpreferredsize(dimension); log_btn.addactionlistener((e) -> { if (!popupbase.isalive(logframe.class)) { new logframe(); } else { popupbase.getalive(logframe.class).reopen(); } }); js_btn.addactionlistener((e) -> { mainjdec.is_enabled.setselected(false); mainjdec.is_enabled.setenabled(false); if (!popupbase.isalive(joystickframe.class)) { new joystickframe(); } else { popupbase.getalive(joystickframe.class).reopen(); } }); stats_btn.addactionlistener((e) -> { if (!popupbase.isalive(statsframe.class)) { new statsframe(); } else { popupbase.getalive(statsframe.class).reopen(); } }); nt_btn.addactionlistener((e) -> { if (!popupbase.isalive(ntframe.class)) { nt_frame = new ntframe(); } else { popupbase.getalive(ntframe.class).reopen(); } }); usb_connect.addactionlistener((e) -> { thread reload = new thread() { @override public void run() { networkreloader.reloadrio(protocol.udp); networkreloader.reloadrio(protocol.tcp); super.run(); interrupt(); } }; reload.start(); }); restart_code_btn.addactionlistener(e -> is_enabled.setselected(false)); team_number.settext("localhost"); team_number.getdocument().adddocumentlistener(new teamnumlistener()); is_enabled.setenabled(false); globalscreen.addnativekeylistener(globalkeylistener.instance .addkeyevent(nativekeyevent.vc_enter, () -> mainjdec.is_enabled.setselected(false)) .addkeyevent(nativekeyevent.vc_space, mainjdec.estop_btn::doclick)); gbcpanelbuilder endr = base.clone().setanchor(gridbagconstraints.line_end).setfill(gridbagconstraints.none); base.clone().setpos(0, 0, 6, 1).setfill(gridbagconstraints.none).build(title); base.clone().setpos(0, 1, 6, 1).setfill(gridbagconstraints.none).build(link); base.clone().setpos(5, 0, 1, 2).setfill(gridbagconstraints.none).build(new jlabel(new imageicon(mainframe.icon_min))); base.clone().setpos(0, 2, 1, 1).build(is_enabled); base.clone().setpos(1, 2, 1, 1).build(robot_drive_mode); base.clone().setpos(0, 3, 2, 1).setfill(gridbagconstraints.none).build(new jlabel("alliance station")); base.clone().setpos(0, 4, 1, 1).build(alliance_num); base.clone().setpos(1, 4, 1, 1).build(alliance_color); endr.clone().setpos(0, 5, 1, 1).build(new jlabel("team number:")); base.clone().setpos(1, 5, 1, 1).setanchor(gridbagconstraints.line_start).build(team_number); endr.clone().setpos(0, 6, 1, 1).build(new jlabel("game data:")); base.clone().setpos(1, 6, 1, 1).setanchor(gridbagconstraints.line_start).build(game_data); endr.clone().setpos(0, 7, 1, 1).build(new jlabel("protocol year:")); base.clone().setpos(1, 7, 1, 1).setanchor(gridbagconstraints.line_start).build(protocol_year); base.clone().setpos(2, 2, 2, 1).build(restart_code_btn); base.clone().setpos(2, 3, 2, 1).build(restart_robo_rio_btn); base.clone().setpos(2, 4, 2, 1).build(estop_btn); base.clone().setpos(2, 5, 1, 1).build(js_btn); base.clone().setpos(3, 5, 1, 1).build(stats_btn); base.clone().setpos(2, 6, 1, 1).build(nt_btn); base.clone().setpos(3, 6, 1, 1).build(log_btn); base.clone().setpos(2, 7, 1, 1).build(fms_connect); base.clone().setpos(3, 7, 1, 1).build(usb_connect); base.clone().setpos(4, 2, 2, 1).setfill(gridbagconstraints.none).build(bat_voltage); endr.clone().setpos(4, 3, 1, 1).build(new jlabel("robot:")); base.clone().setpos(5, 3, 1, 1).setanchor(gridbagconstraints.line_start).build(robot_connection_status); endr.clone().setpos(4, 4, 1, 1).build(new jlabel("code: ")); base.clone().setpos(5, 4, 1, 1).setanchor(gridbagconstraints.line_start).build(robot_code_status); endr.clone().setpos(4, 5, 1, 1).build(new jlabel("estop: ")); base.clone().setpos(5, 5, 1, 1).setanchor(gridbagconstraints.line_start).build(estop_status); endr.clone().setpos(4, 6, 1, 1).build(new jlabel("fms: ")); base.clone().setpos(5, 6, 1, 1).setanchor(gridbagconstraints.line_start).build(fms_connection_status); endr.clone().setpos(4, 7, 1, 1).build(new jlabel("time: ")); base.clone().setpos(5, 7, 1, 1).setanchor(gridbagconstraints.line_start).build(match_time); }