Search in sources :

Example 46 with G_Panel

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

the class G_ScrolledPanel method refresh.

@Override
public void refresh() {
    removeAll();
    resetComps();
    spaceTaken = 0;
    if (isArrowShown(false)) {
        addArrows(false);
    }
    for (int i = offset; i < comps.size(); i++) {
        G_Panel component = comps.get(i);
        int spaceRequired = vertical ? component.getPanelHeight() : component.getPanelWidth();
        if (spaceRequired > getSpace() - spaceTaken) {
            break;
        }
        String y = vertical ? "" + spaceTaken : isCentering() ? "@center_y" : "0";
        String x = !vertical ? "" + spaceTaken : isCentering() ? "@center_x" : "0";
        spaceTaken += spaceRequired;
        add(component, "pos " + x + " " + y);
    }
    if (isArrowShown(true)) {
        addArrows(true);
    }
    refreshComponents();
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 47 with G_Panel

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

the class G_TabbedPagePanel method refresh.

// getdefaultY()
@Override
public void refresh() {
    super.refresh();
    // new G_TabbedPanel();
    if (tabs == null) {
        tabs = new G_Panel(vertical ? "flowy" : "");
    } else {
        tabs.removeAll();
    }
    int i = 0;
    for (E sub : getTabData()) {
        tabs.add(createTab(sub, i));
        i++;
    }
    add(tabs);
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 48 with G_Panel

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

the class BarPanel method initBars.

public void initBars() {
    panel = new G_Panel("flowy");
    int i = 0;
    for (PARAMETER v : vals) {
        ValueBar valueBar = new ValueBar(v, colors.get(i)) {

            public void refresh() {
                super.refresh();
                c_val = max_val;
                max_val = 100;
                percentage = c_val * MathMaster.MULTIPLIER / max_val;
            }

            protected PARAMETER getPercentageParameter(PARAMETER param) {
                return null;
            }
        };
        bars.put(v, valueBar);
        panel.add(valueBar, "w " + getWidth() + ",h " + getHeight());
        i++;
    }
}
Also used : G_Panel(main.swing.generic.components.G_Panel) ValueBar(main.swing.generic.misc.ValueBar) PARAMETER(main.content.values.parameters.PARAMETER)

Example 49 with G_Panel

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

the class FormulaBuilder method initParamTab.

private void initParamTab() {
    Collection<PARAMETER> data = ContentManager.getParamList();
    G_List<PARAMETER> c = new G_List<>(data);
    G_Panel panel = new G_Panel();
    panel.add(c, "pos 0 0");
    String title = PARAMS;
    tabs.addTab(c, title, null);
}
Also used : G_List(main.swing.generic.components.list.G_List) G_Panel(main.swing.generic.components.G_Panel) PARAMETER(main.content.values.parameters.PARAMETER)

Example 50 with G_Panel

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

the class SwingMaster method decorateWithText.

public static G_Panel decorateWithText(String tooltip, Color c, Component box, String constraints) {
    G_Panel wrapper = new G_Panel("flowy");
    wrapper.add(new TextComp(tooltip, c));
    wrapper.add(box, constraints);
    return wrapper;
}
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