Search in sources :

Example 21 with G_Panel

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

the class PointView method generateValuePanel.

private void generateValuePanel() {
    String str = "";
    if (attributes) {
        str = "flowy";
        columns = ATTRIBUTE.values().length;
    }
    valPanel = new G_Panel(str);
    int i = 1;
    for (PARAMETER value : values) {
        addValueComponent(value, i, valPanel);
        i++;
    }
}
Also used : G_Panel(main.swing.generic.components.G_Panel) PARAMETER(main.content.values.parameters.PARAMETER)

Example 22 with G_Panel

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

the class MiniObjComp method initComp.

private void initComp() {
    this.comp = new G_Panel() {

        public void paint(Graphics g) {
            drawImage(g);
            drawInfoIcons(g);
            super.paint(g);
        }
    };
    // MinimapCompMouseListener
    if (!MiniGrid.isMouseDragOffsetModeOn()) {
        // revamp!
        comp.addMouseListener(getMouseListener());
    }
    comp.setPanelSize(size);
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 23 with G_Panel

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

the class TabBuilder method initSelectedWorkspace.

private void initSelectedWorkspace(G_TabbedPanel tab) {
    G_Panel tabComp = (G_Panel) tab.getTabs().getSelectedComponent();
    Workspace workspace = ArcaneVault.getWorkspaceManager().getWorkspaceByTab(tabComp);
    if (workspace != null) {
        tabComp.removeAll();
        Component generateWorkspaceTree = generateWorkspaceTree(workspace);
        tabComp.add(generateWorkspaceTree, "pos 0 0 " + ArcaneVault.TREE_WIDTH + " " + ArcaneVault.TABLE_HEIGHT + "-" + ArcaneVault.TREE_HEIGHT + "/20");
        tabComp.revalidate();
        workspace.setDirty(false);
    }
}
Also used : G_Panel(main.swing.generic.components.G_Panel) Workspace(main.utilities.workspace.Workspace)

Example 24 with G_Panel

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

the class TabBuilder method addWorkspaceTab.

public void addWorkspaceTab(Workspace workspace) {
    if (getActiveWorkspaces().contains(workspace)) {
        return;
    }
    if (workspace.isSearch()) {
        if (searchTab == null) {
            addSearchTopTab();
        }
    } else if (workspaceTab == null) {
        addWorkspaceTopTab();
    }
    G_Panel tabComp = new G_Panel();
    tabComp.add(generateWorkspaceTree(workspace), "pos 0 0 " + ArcaneVault.TREE_WIDTH + " " + ArcaneVault.TABLE_HEIGHT + "-" + ArcaneVault.TREE_HEIGHT + "/20");
    (workspace.isSearch() ? searchTab : workspaceTab).addTab(tabComp, workspace.getName());
    workspace.setTabComp(tabComp);
}
Also used : G_Panel(main.swing.generic.components.G_Panel)

Example 25 with G_Panel

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

the class AV_TreeCellRenderer method getTreeCellRendererComponent.

@Override
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
    if (tree == null) {
        LogMaster.log(1, "NULL TREE!");
        return null;
    }
    DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
    String typeName = node.toString();
    ObjType type = null;
    String parent = null;
    try {
        parent = ((DefaultMutableTreeNode) node.getParent()).getUserObject().toString();
    } catch (Exception e) {
    }
    try {
        if (DataManager.isTypeName(typeName, TYPE))
            if (workspace != null) {
                type = DataManager.getType(typeName, workspace.getOBJ_TYPE(typeName, parent));
            } else {
                type = DataManager.getType(typeName, TYPE);
            }
        if (type == null) {
            if (node.isLeaf()) {
                LogMaster.log(1, "No such type: " + " " + typeName);
            }
            return getDefaultComp(tree, value, selected, expanded, leaf, row, hasFocus);
        }
        Image img = ImageManager.getImage(type.getImagePath());
        if (img == null) {
            // typeName);
            return getDefaultComp(tree, value, selected, expanded, leaf, row, hasFocus);
        }
        size = Math.min(getMaxTreeIconSize(), img.getWidth(null));
        G_Panel comp = new G_Panel();
        ListItem<ObjType> item = new ListItem<>(type, selected, hasFocus, size);
        comp.add(item, "id item, pos 0 0");
        JLabel lbl = new JLabel(typeName);
        if (selected || hasFocus) {
            Color aspectColor = ColorManager.getAspectColor(type);
            Color bgColor = ColorManager.OBSIDIAN;
            // if (colorsInverted) {
            // bgColor = ColorManager.GOLDEN_WHITE;
            // aspectColor = ColorManager.getDarkerColor(aspectColor, 50);
            // }
            lbl.setForeground(aspectColor);
            lbl.setBackground(bgColor);
        } else if (colorsInverted) {
            lbl.setForeground(ColorManager.GOLDEN_WHITE);
        }
        comp.add(lbl, "pos item.x2+" + FontMaster.SIZE / 4 + " item.y2/2-" + FontMaster.SIZE / 2 + "");
        return comp;
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
        return getDefaultComp(tree, value, selected, expanded, leaf, row, hasFocus);
    }
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) ObjType(main.entity.type.ObjType) G_Panel(main.swing.generic.components.G_Panel) ListItem(main.swing.generic.components.list.ListItem)

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