Search in sources :

Example 51 with G_Panel

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

the class T3UpperPanel method init.

public void init() {
    heroPortrait = new PortraitComp(hero);
    controlPanel = new G_Panel();
    for (final String c : controls) {
        controlPanel.add(new CustomButton(VISUALS.BUTTON_NEW_TINY, (c)) {

            public void handleClick() {
                handleControl(c, false);
            }

            @Override
            public void handleAltClick() {
                handleControl(c, true);
            }
        });
    }
    add(controlPanel, "id cp, pos @center_x 0");
    add(heroPortrait.getComp(), "pos @center_x cp.y2");
}
Also used : G_Panel(main.swing.generic.components.G_Panel) CustomButton(eidolons.swing.components.buttons.CustomButton) PortraitComp(eidolons.client.cc.gui.neo.header.PortraitComp)

Example 52 with G_Panel

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

the class MapObjComp method initComp.

protected void initComp() {
    d = getDimension();
    Image image = getImage();
    label = new JLabel(new ImageIcon(image));
    G_Panel imgPanel = new G_Panel(label);
    // TODO pos for symbol vs image
    comp.add(imgPanel);
    comp.setPanelSize(d);
    comp.addMouseListener(this);
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 53 with G_Panel

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

the class MapComp method refresh.

public void refresh() {
    // re-evaluate available Routes
    getComp().removeAll();
    G_Panel backgroundComp = getBackgroundComp();
    // ++ border of sorts?
    getComp().add(backgroundComp);
    if (listener != null) {
        backgroundComp.addMouseListener(listener);
    }
    index = 0;
    if (playerPartyComp == null) {
        playerPartyComp = new PartyComp(getParty());
    }
    Coordinates ppp = getPlayerPartyPoint();
    getComp().add(playerPartyComp.getComp(), "pos " + ppp.x + " " + ppp.y);
    comp.setComponentZOrder(playerPartyComp.getComp(), index);
    index++;
    resetVisiblePlaces();
    resetDisplayedRoutes();
    for (Coordinates p : routes.keySet()) {
        // ++ refresh
        RouteComp routeComp = routes.get(p);
        add(routeComp, "pos " + p.x + " " + p.y);
        routeComp.refresh();
    }
    for (Coordinates p : places.keySet()) {
        // ++ symbol if not available?
        PlaceComp placeComp = places.get(p);
        // Selectable?
        getComp().add(placeComp.getComp(), "pos " + p.x + " " + p.y);
        comp.setComponentZOrder(placeComp.getComp(), index);
        index++;
        placeComp.refresh();
    }
    comp.setComponentZOrder(backgroundComp, index);
    addSpecialIcons();
    // Route route = getParty().getCurrentRoute();
    // if (route != null) {
    // getComp().add(
    // route.getComp().getComp(),
    // "pos " + route.getMapPoint().x + " "
    // + route.getMapPoint().y);
    // }
    // only display the active route if traveling!
    getComp().revalidate();
}
Also used : RouteComp(eidolons.game.module.adventure.gui.map.obj.RouteComp) PartyComp(eidolons.game.module.adventure.gui.map.obj.PartyComp) G_Panel(main.swing.generic.components.G_Panel) Coordinates(main.game.bf.Coordinates) PlaceComp(eidolons.game.module.adventure.gui.map.obj.PlaceComp)

Example 54 with G_Panel

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

the class GenericListChooser method initPanel.

protected void initPanel() {
    panel = new G_Panel();
    // if (list == null)
    initList();
    JScrollPane scroll = new JScrollPane(list);
    int height = getPanelHeight();
    int width = getPanelWidth();
    panel.setPanelSize(new Dimension(width, height));
    String listPanelHeight = height + "-40";
    scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    panel.add(scroll, "id list1, pos 0 0, h " + listPanelHeight + "!");
    if (secondList != null) {
        JScrollPane scroll2 = new JScrollPane(secondList);
        scroll2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        panel.add(scroll2, "id list2, pos list1.x2+50 0, h " + listPanelHeight + "!");
        // panel.add(buttonPanel, "id bp, pos 0 " + listPanelHeight);
        panel.add(buttonPanel, "id bp, pos 0 list2.y2");
    } else {
    // list.addMouseListener(listener);
    }
    if (tooltipMap == null) {
        tooltipMap = map;
        map = null;
    }
    toolTipPanel = new TextComp() {

        @Override
        protected Color getColor() {
            return Color.black;
        }
    };
    panel.add(toolTipPanel, "id tp, pos ip.x @max_y");
    toolTipMainPanel = new TextComp(tooltip) {

        @Override
        protected Color getColor() {
            return Color.black;
        }
    };
    panel.add(toolTipMainPanel, "id tmp, pos @max_x+(max_x*(-3)) 0");
    if (decorator == null) {
        decorator = panelDecorator;
        panelDecorator = null;
    }
    if (decorator != null) {
        decorator.addComponents(panel);
    }
}
Also used : G_Panel(main.swing.generic.components.G_Panel) TextComp(main.swing.components.TextComp)

Example 55 with G_Panel

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

the class OptionDialog method createComponent.

@Override
public Component createComponent() {
    panel = new G_Panel(getVisuals());
    if (vertical) {
        panel.setLayout(new MigLayout("fillx, flowy"));
    } else {
        panel.setLayout(new MigLayout("fillx"));
    }
    // panel.add(new TextComp(null, title), "");
    for (Object o : options) {
        addButton(o);
    }
    WrappedTextComp comp = new WrappedTextComp(null, true) {

        protected int getDefaultFontSize() {
            return 16;
        }

        public void wrapTextLines() {
            super.wrapTextLines();
        }

        protected Dimension initDefaultSize() {
            return getPanelSize();
        }

        public Dimension getPanelSize() {
            return new Dimension(OptionDialog.this.getVisuals().getWidth() - 42, OptionDialog.this.getVisuals().getHeight() - VISUALS.BUTTON.getHeight() - 32);
        }
    };
    comp.setPanelSize(new Dimension(getVisuals().getWidth() - 42, getVisuals().getHeight() - VISUALS.BUTTON.getHeight() - 32));
    comp.setText(title);
    comp.refresh();
    panel.add(comp, "@pos center_x 75");
    return panel;
}
Also used : G_Panel(main.swing.generic.components.G_Panel) MigLayout(net.miginfocom.swing.MigLayout) WrappedTextComp(eidolons.swing.components.panels.page.log.WrappedTextComp)

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