Search in sources :

Example 1 with G_Panel

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

the class ButtonChoicePanel method init.

private void init() {
    panel = new G_Panel(getPanelVisuals());
    panel.setMigLayout(getArgs());
    int i = 0;
    // G_Panel buttonPanel = new G_Panel("flowy");
    for (String l : listData) {
        String pos = "";
        i++;
        if (i >= wrap) {
            pos = "wrap";
            columns++;
            i = 0;
        }
        panel.add(createButton(l), pos);
    // buttonPanel.add(createButton(l), pos);
    }
    // panel.setVisuals(getPanelVisuals());
    // panel.add(buttonPanel, "pos 40 40");
    SIZE = getPanelVisuals().getSize();
// new Dimension(columnWidth *columns,Math.max(columns*wrap, i)*
// getVisuals().getHeight());
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 2 with G_Panel

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

the class BfGridComp method initPanel.

private void initPanel() {
    // GuiEventManager.trigger(GRID_CREATED, new OnDemandEventCallBack<>(
    // new ImmutablePair<>(getCellsX(), getCellsY())));
    panel = new G_Panel() {

        protected void paintComponent(Graphics g) {
            // Chronos
            game.getAnimationManager().paintCalledOnBfGrid();
            if (paintImage == null) {
                return;
            }
            g.drawImage(paintImage, 0, 0, null);
            if (!isLevelEditor()) {
                game.getAnimationManager().drawAnimations(g);
            }
        // if (isOffsetIsNotReady()) {
        // offsetIsNotReady = false;
        // main.system.auxiliary.LogMaster
        // .log(1,
        // "!!isOffsetIsNotReadyisOffsetIsNotReadyisOffsetIsNotReadyisOffsetIsNotReady ");
        // return;
        // }
        // main.system.auxiliary.LogMaster.log(1,
        // "+++ paintComponent ");
        }
    };
    panel.setPanelSize(new Dimension(getWidth(), getHeight()));
    bfMouseListener = new BfMouseListener(this);
    panel.addMouseListener(bfMouseListener);
    if (customMouseListener != null) {
        panel.addMouseListener(customMouseListener);
    }
    panel.addMouseMotionListener(bfMouseListener);
    panel.addMouseWheelListener(bfMouseListener);
    panel.setIgnoreRepaint(true);
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 3 with G_Panel

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

the class DC_TopPanel method toggleDebugGui.

public void toggleDebugGui() {
    refresh();
    if (debugGui == null) {
        debugGui = new DebugGui();
    }
    debugOn = !debugOn;
    G_Panel removed = !debugOn ? debugGui : topComp;
    G_Panel added = debugOn ? debugGui : topComp;
    remove(removed);
    add(added);
    add(added, !debugOn ? "pos " + xOffset + " 0" + ", id top" : "pos 0 0");
    if (debugOn) {
        setPanelSize(new Dimension(debugGui.getPanelSize()));
    }
    // else
    // setPanelSize(topComp.getVisuals().getSize());
    setComponentZOrder(button, 0);
    setComponentZOrder(added, 1);
    revalidate();
    repaint();
}
Also used : G_Panel(main.swing.generic.components.G_Panel) DebugGui(eidolons.test.debug.DebugGui)

Example 4 with G_Panel

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

the class GatewayWindow method initButtonPanel.

private G_Panel initButtonPanel() {
    int i = 0;
    G_Panel buttonPanel = new G_Panel("  ");
    buttonPanel.setPanelSize(new Dimension(GuiManager.getScreenWidthInt(), 64));
    for (String command : GatewayButtonHandler.BUTTONS) {
        command = StringMaster.getWellFormattedString(command);
        JButton btn = new JButton(command);
        String pos = "";
        i++;
        // if (i >= wrapButtons) {
        // i = 0;
        // pos = "wrap";
        // }
        buttonPanel.add(btn, pos);
        btn.setActionCommand(command);
        btn.addActionListener(buttonHandler);
    }
    return buttonPanel;
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 5 with G_Panel

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

the class SessionWindow method init.

public void init() {
    panel = new G_Panel("flowy");
    sessionControlPanel = new SessionControlPanel(session);
    String pos = "pos 0 0, id sessionControlPanel";
    panel.add(sessionControlPanel, pos);
    timer = new SessionTimer(session, session.getIntParam(AT_PARAMS.SESSION_TIME));
    // pos = "pos @center_x directionHeader.y2, id timer";
    pos = "pos 0 sessionControlPanel.y2, id timer";
    panel.add(timer, pos);
    // timer.x2
    boxPanel = new G_Panel();
    pos = "pos @center_x-125 directionHeader.y2-30, id boxPanel";
    panel.add(boxPanel, pos);
    directionBox = initBox(getDirections(), "Direction");
    styleBox = initBox(WORK_STYLE.values(), "Style");
    stateBox = initBox(STATE.values(), "State");
    viewBox = initBox(VIEW_OPTION.values(), "Custom View");
    directionHeader = new DirectionHeader(session);
    pos = "pos 0 sessionControlPanel.y2, id directionHeader";
    panel.add(directionHeader, pos);
    goalsPanel = new GoalPages(session);
    pos = "pos 0 timer.y2, id goalsPanel";
    panel.add(goalsPanel, pos);
    infoPanel = new InfoEditPanel();
    pos = "pos goalsPanel.x2 directionHeader.y2+50, id infoPanel";
    panel.add(infoPanel.getPanel(), pos);
    lockButton = new CustomButton(VISUALS.LOCK) {

        @Override
        public VISUALS getVisuals() {
            return session.isLocked() ? VISUALS.LOCK : VISUALS.UNLOCK;
        }

        @Override
        public void handleClick() {
            session.setLocked(!session.isLocked());
            refresh();
        }
    };
    pos = "pos timer.x+85 timer.y2-50, id lockButton";
    panel.add(lockButton, pos);
    panel.refreshComponents();
}
Also used : VISUALS(main.swing.generic.components.G_Panel.VISUALS) G_Panel(main.swing.generic.components.G_Panel) CustomButton(eidolons.swing.components.buttons.CustomButton)

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