Search in sources :

Example 36 with G_Panel

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

the class MusicCore method getGroupedView.

public static MusicListPanel getGroupedView(int option, Class<?> constClass) {
    if (option == -1) {
        return null;
    }
    PROPERTY filterProp = ContentManager.getPROP(constClass.getSimpleName());
    // String[] array = (AHK_Master.qwerty + " " +
    // AHK_Master.qwerty.substring(1).toUpperCase() + " 123")
    // .split(" ");
    String viewName = "All " + StringMaster.getWellFormattedString(constClass.getSimpleName());
    Map<String, List<String>> map = new XLinkedMap<>();
    List<String> musicConsts = EnumMaster.getEnumConstantNames(constClass);
    if (option != 0) {
        musicConsts = getMusicConsts(constClass, option);
        viewName = getViewName(constClass, option);
    }
    Map<ObjType, String> multiPropMap = new HashMap<>();
    loop: for (String g : musicConsts) {
        // map.
        List<String> list = new ArrayList<>();
        // for (MusicList musList : listTypeMap.values()) {
        typeLoop: for (ObjType type : DataManager.getTypes(AT_OBJ_TYPE.MUSIC_LIST)) {
            if (type.checkProperty(filterProp, g)) {
                if (filterProp.isContainer()) {
                    containerLoop: for (String sub : StringMaster.open(type.getProperty(filterProp))) {
                        for (String c : musicConsts) {
                            if (StringMaster.compare(c, sub)) {
                                if (c.equalsIgnoreCase(g)) {
                                    break containerLoop;
                                } else {
                                    multiPropMap.put(type, c);
                                    continue typeLoop;
                                }
                            }
                        }
                    }
                }
                list.add(AHK_Master.getScriptLineForList(type));
            }
        }
        map.put(g, list);
    }
    for (ObjType sub : multiPropMap.keySet()) {
        for (String c : map.keySet()) {
            if (multiPropMap.get(sub).equals(c)) {
                map.get(c).add(AHK_Master.getScriptLineForList(sub));
            }
        }
    }
    for (String sub : map.keySet()) {
        map.put(sub, new ArrayList<>(new LinkedHashSet<>(map.get(sub))));
    }
    // TODO adapt to max list size also
    int wrap = 5 - map.size() / 2;
    MusicListPanel musicListPanel = new MusicListPanel("", null);
    G_Panel view = // AHK_Master.getPanel()
    musicListPanel.initView(map, false, wrap, musicConsts);
    musicListPanel.setView(view);
    view.setName(viewName);
    return musicListPanel;
}
Also used : PROPERTY(main.content.values.properties.PROPERTY) XLinkedMap(main.data.XLinkedMap) G_Panel(main.swing.generic.components.G_Panel) ObjType(main.entity.type.ObjType) MusicListPanel(main.music.gui.MusicListPanel) MusicList(main.music.entity.MusicList) List(java.util.List)

Example 37 with G_Panel

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

the class GoalPages method createPageComponent.

@Override
protected G_Component createPageComponent(List<Goal> list) {
    G_Panel goalsPanel = new G_Panel();
    for (Goal goal : list) {
        if (goal == null) {
            continue;
        }
        GoalPanel goalPanel = new GoalPanel(goal);
        goalsPanel.add(goalPanel);
    }
    return goalsPanel;
}
Also used : Goal(main.logic.Goal) G_Panel(main.swing.generic.components.G_Panel)

Example 38 with G_Panel

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

the class GatewayWindow method init.

public void init() {
    panel = new G_Panel();
    G_Panel backgroundPanel = initBackgroundPanel();
    String pos = "pos 0 0, id backgroundPanel";
    // panel.add(backgroundPanel, pos);
    G_Panel buttonPanel = initButtonPanel();
    pos = "pos 0 0, id buttonPanel";
    panel.add(buttonPanel, pos);
    view = new GatewayView();
    pos = "pos 0 buttonPanel.y2, id gatewayView";
    panel.add(view, pos);
// G_Panel statsPanel; //
// G_Panel sessionInfoPanel;
// G_Panel objEditPanel; // task, goal, ...
// G_Panel boxPanel; // switch style,
}
Also used : G_Panel(main.swing.generic.components.G_Panel) GatewayView(main.gui.gateway.GatewayView)

Example 39 with G_Panel

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

the class GatewayWindow method initBackgroundPanel.

private G_Panel initBackgroundPanel() {
    Image img = getBackgroundPicture();
    G_Panel panel = new G_Panel(new CompVisuals(img));
    // img = DC_GameGUI.createBackgroundOverlay();
    panel.add(new JLabel(new ImageIcon(img)));
    return panel;
}
Also used : G_Panel(main.swing.generic.components.G_Panel) CompVisuals(main.swing.generic.components.CompVisuals)

Example 40 with G_Panel

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

the class SessionWindow method initBox.

private JComboBox initBox(Object[] items, String tooltip) {
    JComboBox<?> box = new JComboBox<>(items);
    box.setSelectedIndex(0);
    box.addActionListener(this);
    G_Panel wrapper = new G_Panel("flowy");
    wrapper.add(new TextComp(tooltip, Color.black));
    wrapper.add(box, "pos 0 20");
    boxPanel.add(wrapper);
    return box;
}
Also used : G_Panel(main.swing.generic.components.G_Panel) TextComp(main.swing.components.TextComp)

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