Search in sources :

Example 1 with G_Frame

use of main.swing.generic.windows.G_Frame in project Eidolons by IDemiurge.

the class Launcher method initTopGUI.

private static void initTopGUI() {
    frame = new G_Frame(MAIN_TITLE, true);
    // setCustomCursor()
    setCustomIcon();
    if (!GuiManager.isWide()) {
        frame.setLayout(new GridLayout());
        viewPanel = new G_Panel();
        viewPanel.setLayout(new GridLayout());
        viewPanel.setSize(// TODO
        GuiManager.getScreenSize());
        frame.add(viewPanel, "pos 0 0");
    } else {
        DEV_MODE = false;
        initBackground();
        frame.add(background, "pos 0 0");
        viewPanel = new G_Panel();
        // otherwise there is this
        viewPanel.setLayout(new GridLayout());
        // size calc issue? viewPanel.setSize(VIEW_PANEL_SIZE);
        double X = (GuiManager.getScreenWidth() - VIEW_PANEL_SIZE.getWidth()) / 2;
        double Y = (GuiManager.getScreenHeight() - VIEW_PANEL_SIZE.getHeight()) / 2;
        frame.setLayout(new MigLayout());
        G_Panel panel = new G_Panel();
        panel.setPanelSize(GuiManager.getScreenSize());
        panel.setSize(GuiManager.getScreenSize());
        panel.add(viewPanel, "pos " + X + " " + Y);
        panel.setOpaque(true);
        panel.setBackground(ColorManager.BACKGROUND);
        frame.add(panel, "pos 0 0");
        frame.setComponentZOrder(panel, 0);
        frame.setComponentZOrder(background, 1);
    }
    if (fullscreen) {
        GuiManager.setFullscreen(true);
        GuiManager.setWindowToFullscreen(frame);
    } else {
        frame.setSize(GuiManager.getScreenSize());
    // frame.setBackground(Color.black);
    }
    frame.setUndecorated(true);
    frame.setVisible(true);
}
Also used : G_Frame(main.swing.generic.windows.G_Frame) G_Panel(main.swing.generic.components.G_Panel) MigLayout(net.miginfocom.swing.MigLayout)

Aggregations

G_Panel (main.swing.generic.components.G_Panel)1 G_Frame (main.swing.generic.windows.G_Frame)1 MigLayout (net.miginfocom.swing.MigLayout)1