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++;
}
}
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);
}
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);
}
}
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);
}
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);
}
}
Aggregations