Search in sources :

Example 1 with HT_View

use of eidolons.client.cc.gui.neo.tree.view.HT_View in project Eidolons by IDemiurge.

the class EditViewPanel method selectType.

public void selectType(boolean fromHT, ObjType type) {
    toggleAE_VIEW();
    if (ArcaneVault.getSelectedType() != null) {
        if (type.getOBJ_TYPE_ENUM().isHeroTreeType()) {
            if (type.getOBJ_TYPE_ENUM() != ArcaneVault.getSelectedType().getOBJ_TYPE_ENUM()) {
                if (getSkillTreeViewComp() == null || getClassTreeViewComp() == null) {
                    setTreeView(false);
                } else {
                    setDirty(true);
                }
            }
        }
    }
    ArcaneVault.setSelectedType(type);
    if (fromHT) {
        try {
            ModelManager.adjustTreeTabSelection(type, false);
        } catch (Exception e) {
            main.system.ExceptionMaster.printStackTrace(e);
        }
    } else {
        if (isTreeView()) {
            if (getTreeViewComp() != null) {
                HT_Node node = null;
                try {
                    node = getTreeViewComp().getTree().getMap().getNodeForType(type);
                } catch (Exception e) {
                    main.system.ExceptionMaster.printStackTrace(e);
                    setTreeView(false);
                    selectType(fromHT, type);
                }
                if (node != null) {
                    HC_Master.setSelectedTreeNode(node);
                    getTreeViewComp().getTree().getPanel().repaint();
                }
            }
        }
    }
    if (isTreeView()) {
        HT_View viewComp = type.getOBJ_TYPE_ENUM() == DC_TYPE.SKILLS ? getSkillTreeViewComp() : getClassTreeViewComp();
        if (viewComp != null) {
            String key = type.getSubGroupingKey();
            if (!key.equalsIgnoreCase(viewComp.getDisplayedTabPanel().getSelectedTabName())) {
                if (!key.equalsIgnoreCase("Multiclass")) {
                    try {
                        viewComp.tabSelected(key);
                        viewComp.repaint();
                        setDirty(true);
                    } catch (Exception e) {
                        main.system.ExceptionMaster.printStackTrace(e);
                    }
                }
            }
        }
    }
    try {
        resetData(type);
    } catch (Exception e) {
        main.system.ExceptionMaster.printStackTrace(e);
    }
    if (type.getOBJ_TYPE_ENUM().isTreeEditType()) {
        setAE_View(type.getName());
    } else {
        setTableView();
    }
}
Also used : HT_Node(eidolons.client.cc.gui.neo.tree.HT_Node) HT_View(eidolons.client.cc.gui.neo.tree.view.HT_View)

Example 2 with HT_View

use of eidolons.client.cc.gui.neo.tree.view.HT_View in project Eidolons by IDemiurge.

the class AV_T3View method toggleEditTable.

public static void toggleEditTable(Boolean left_right_center) {
    // TODO for currently active tree...
    // alt click - let choose, otherwise active...
    String pos = comp.getCenterTreePos();
    if (left_right_center != null) {
        pos = left_right_center ? comp.getLeftTreePos() : comp.getRightTreePos();
    }
    HT_View tree = comp.getCenterTree();
    if (left_right_center != null) {
        tree = left_right_center ? comp.getLeftTree() : comp.getRightTree();
    }
    if (comp.getRemovedTree() != null) {
        comp.remove(table.getPanel());
        comp.add(comp.getRemovedTree(), pos);
        if (left_right_center != null) {
            if (left_right_center) {
                comp.add(comp.getInfoPanel(), comp.getInfoPanelPos());
            } else {
                comp.add(comp.getInfoPanel2(), comp.getInfoPanel2Pos());
            }
        }
        comp.setRemovedTree(null);
    } else {
        if (table == null) {
            table = new EditViewPanel() {

                // no second table! sync selection!
                public boolean isTwoTableModeEnabled() {
                    return false;
                }

                @Override
                public void selectType(ObjType type) {
                    resetData(type);
                    setTableView();
                }

                protected int getHeight() {
                    return comp.getTreeSize().height;
                }

                public boolean isMenuHidden() {
                    return true;
                }

                protected int getWidth() {
                    return comp.getTreeSize().width;
                }

                protected void initTable(boolean second) {
                    super.initTable(second);
                    table.setTableHeader(null);
                // scrollPane
                // .setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
                }
            };
        }
        if (HC_Master.getSelectedTreeNode() != null) {
            table.selectType(HC_Master.getSelectedTreeNode().getType());
        }
        if (left_right_center != null) {
            if (left_right_center) {
                comp.remove(comp.getInfoPanel());
            } else {
                comp.remove(comp.getInfoPanel2());
            }
        }
        comp.remove(tree);
        comp.setRemovedTree(tree);
        comp.add(table.getPanel(), pos);
    }
    comp.revalidate();
    comp.repaint();
}
Also used : HT_View(eidolons.client.cc.gui.neo.tree.view.HT_View) ObjType(main.entity.type.ObjType) EditViewPanel(main.gui.builders.EditViewPanel)

Example 3 with HT_View

use of eidolons.client.cc.gui.neo.tree.view.HT_View in project Eidolons by IDemiurge.

the class AV_T3View method toggleEditTable.

public static void toggleEditTable() {
    Boolean left_right_center = null;
    HT_View relevantTree = comp.getRemovedTree();
    if (relevantTree == null) {
        relevantTree = comp.getActiveTree();
    }
    if (relevantTree == comp.getLeftTree()) {
        left_right_center = true;
    }
    if (relevantTree == comp.getRightTree()) {
        left_right_center = false;
    }
    toggleEditTable(left_right_center);
}
Also used : HT_View(eidolons.client.cc.gui.neo.tree.view.HT_View)

Aggregations

HT_View (eidolons.client.cc.gui.neo.tree.view.HT_View)3 HT_Node (eidolons.client.cc.gui.neo.tree.HT_Node)1 ObjType (main.entity.type.ObjType)1 EditViewPanel (main.gui.builders.EditViewPanel)1