Search in sources :

Example 31 with G_Panel

use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.

the class TabBuilder method getTree.

public JTree getTree() {
    JTree tree;
    if (top) {
        if (getTabbedPane().getSelectedIndex() >= builderArray.length) {
            G_Panel tabComp = (G_Panel) getTabbedPane().getSelectedComponent();
            tree = (JTree) tabComp.getComponent(0);
        } else {
            tree = ((TabBuilder) builderArray[getTabbedPane().getSelectedIndex()]).getTree();
        }
    } else {
        int index = getTabbedPane().getSelectedIndex();
        TreeViewBuilder selectedTree = ((TreeViewBuilder) builderArray[index]);
        tree = selectedTree.getTree();
    }
    if (tree == null) {
        Err.info("NULL TREE OBJECT!");
    }
    return tree;
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 32 with G_Panel

use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.

the class LE_MapViewComp method addLevel.

public void addLevel(Level level) {
    if (mission == null) {
        levels.add(level);
    } else {
        mission.addLevel(level);
    }
    G_Panel panel = new G_Panel();
    panel.setKeyManager(mainPanel.getKeyManager());
    panel.addKeyListener(mainPanel.getKeyManager());
    panel.setPanelSize(SIZE);
    tabs.addTab(level.getName(), level.getDungeon().getImagePath(), panel);
    // TODO support tab sort/swap
    try {
        tabs.selectLast();
    // tabSelected(tabs.getTabs().size() - 1);
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 33 with G_Panel

use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.

the class LE_Palette method refresh.

public void refresh() {
    if (workspaceControlTab == null) {
        workspaceControlTab = new G_Panel(VISUALS.H_LIST_2_8);
        workspaceControlTab.setLayout(new MigLayout("fill, insets 5 2 20 0"));
        CustomButton newButton = new CustomButton("New") {

            public void handleClick() {
                newPalette();
            }
        };
        workspaceControlTab.add(newButton);
        CustomButton addButton = new CustomButton("Add") {

            public void handleClick() {
                addWorkspaces();
            }
        };
        workspaceControlTab.add(addButton);
        CustomButton deleteButton = new CustomButton("Delete") {

            public void handleClick() {
                deletePalettes(false);
            }

            public void handleAltClick() {
                deletePalettes(true);
            }
        };
        workspaceControlTab.add(deleteButton);
        paletteTabs.addTab(// PAGE_SIZE - 1, "Custom",
        "Custom", workspaceControlTab);
    }
    paletteTabs.refresh();
}
Also used : G_Panel(main.swing.generic.components.G_Panel) MigLayout(net.miginfocom.swing.MigLayout) CustomButton(eidolons.swing.components.buttons.CustomButton)

Example 34 with G_Panel

use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.

the class ListButtonPanel method refresh.

@Override
public void refresh() {
    removeAll();
    int n = 0;
    int i = 0;
    for (final String chars : map.keySet()) {
        List<String> lines = map.get(chars);
        lines = panel.sort(lines, chars);
        int wrap = customWrap;
        if (wrap != 0) {
            wrap += Math.min(2, Math.abs(Math.round((wrap * 10 - lines.size()) / 10)));
            TextComp comp = new TextComp(StringMaster.getWellFormattedString(musicConsts.get(i)), Color.black) {

                @Override
                public int getPanelHeight() {
                    return super.getPanelHeight() / 3 * 2;
                }

                @Override
                protected int getDefaultFontSize() {
                    return 15;
                }
            };
            add(comp, "x @center_x");
            if (i == 0) {
                add(comp, "x @center_x");
            }
            i++;
        }
        G_Panel subPanel = new G_Panel("flowy");
        if (wrap == 0) {
            subPanel.setPanelSize(new Dimension(GuiManager.getScreenWidthInt(), GuiManager.getScreenHeightInt() / map.keySet().size()));
            add(subPanel);
        } else {
            add(subPanel, "w " + GuiManager.getScreenWidthInt());
        }
        Character lastLetter = null;
        boolean letterAdded = false;
        for (String line : lines) {
            try {
                char letter = AHK_Master.getLetter(line);
                n = addButton(wrap, n, subPanel, lastLetter, letterAdded, line, letter);
                lastLetter = letter;
                letterAdded = n == 0;
            } catch (Exception e) {
                LogMaster.log(1, "failed: " + line);
                main.system.ExceptionMaster.printStackTrace(e);
            }
        }
    }
}
Also used : G_Panel(main.swing.generic.components.G_Panel) TextComp(main.swing.components.TextComp)

Example 35 with G_Panel

use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.

the class MC_ControlPanel method addBox.

private void addBox(JComboBox<?> box, String tooltip, boolean wrap) {
    box.addActionListener(this);
    G_Panel wrapper = SwingMaster.decorateWithText(tooltip, Color.black, box, "pos 0 20");
    boxPanel.add(wrapper, (wrap ? "wrap" : ""));
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Aggregations

G_Panel (main.swing.generic.components.G_Panel)59 CustomButton (eidolons.swing.components.buttons.CustomButton)6 List (java.util.List)4 PARAMETER (main.content.values.parameters.PARAMETER)4 ObjType (main.entity.type.ObjType)4 TextComp (main.swing.components.TextComp)4 ArrayList (java.util.ArrayList)3 XLinkedMap (main.data.XLinkedMap)3 MigLayout (net.miginfocom.swing.MigLayout)3 PoolComp (eidolons.client.cc.gui.misc.PoolComp)2 HC_Tab (eidolons.client.cc.gui.neo.tabs.HC_Tab)2 HC_TabPanel (eidolons.client.cc.gui.neo.tabs.HC_TabPanel)2 WrappedTextComp (eidolons.swing.components.panels.page.log.WrappedTextComp)2 MusicList (main.music.entity.MusicList)2 MusicListPanel (main.music.gui.MusicListPanel)2 G_Component (main.swing.generic.components.G_Component)2 GraphicComponent (main.swing.generic.components.misc.GraphicComponent)2 PortraitComp (eidolons.client.cc.gui.neo.header.PortraitComp)1 HC_PagedListPanel (eidolons.client.cc.gui.pages.HC_PagedListPanel)1 PartyComp (eidolons.game.module.adventure.gui.map.obj.PartyComp)1