use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class UnlockDialog method createComponent.
@Override
public Component createComponent() {
G_Panel panel = new G_Panel(PANEL_WIDE);
CustomButton xpButton = new UnlockButton(true);
xpButton.setToolTipText(XP);
xpButton.setText(xpCost + " xp");
CustomButton goldButton = new UnlockButton(false);
goldButton.setText(goldCost + " gold");
goldButton.setToolTipText(GOLD);
CustomButton cancelButton = new CustomButton(VISUALS.CANCEL) {
@Override
public void handleClick() {
cancel();
}
};
TextCompDC label = new TextCompDC(VISUALS.PROP_BOX);
label.setText("Unlock " + param.getName());
panel.add(label, "pos 20 50");
if (xpCost > 0) {
panel.add(xpButton, "pos 50 100");
}
panel.add(cancelButton, "pos 300 50");
if (goldCost > 0) {
panel.add(goldButton, "pos 300 100");
}
return panel;
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class SkillTreeView method initTabList.
protected List<HC_Tab> initTabList() {
List<HC_Tab> tabList = new ArrayList<>();
// 'mine only' mode
// for (SKILL_DISPLAY_GROUPS group : SKILL_DISPLAY_GROUPS.values())
PARAMETER[] array = getParamsFromMasteryWorkspaceArray();
if (array == null) {
array = ValuePages.MASTERIES;
}
List<PARAMETER> masteries = new ArrayList<>(Arrays.asList(array));
if (mineOnly) {
masteries = DC_MathManager.getUnlockedMasteries(hero);
}
DC_ContentManager.sortMasteries(hero, masteries);
for (final PARAMETER mastery : masteries) {
// DC_ContentManager.getMasteries()
HC_Tab tab = tabMap.get(mastery);
if (tab == null) {
G_Component comp = new G_Panel(getPanelVisuals());
int index = 0;
tab = new HC_Tab(mastery.getName(), comp, index) {
@Override
public Component generateTabComp(HC_TabPanel panel) {
return new GraphicComponent(ImageManager.getNewBufferedImage(getTabCompWidth(), getTabCompWidth())) {
public Image getImg() {
boolean locked = !DC_MathManager.isMasteryUnlocked(hero, mastery);
try {
image = HC_Master.generateValueIcon(mastery, isSelected(), locked, true);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
image = ImageManager.getNewBufferedImage(getTabCompWidth(), getTabCompWidth());
}
return image;
}
};
}
};
}
tabList.add(tab);
tabMap.put(mastery, tab);
}
return tabList;
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class LE_PlanPanel method refresh.
public void refresh() {
previontrolGroup = controlGroup;
controlGroup = DYNAMIC_CONTROL_GROUPS.MISSION;
if (LevelEditor.isMouseInfoMode()) {
controlGroup = DYNAMIC_CONTROL_GROUPS.OBJ;
} else {
if (LevelEditor.isLevelSelected()) {
controlGroup = DYNAMIC_CONTROL_GROUPS.LEVEL;
} else if (getSelectedBlock() != null) {
controlGroup = DYNAMIC_CONTROL_GROUPS.BLOCK;
}
}
if (previontrolGroup != controlGroup) {
G_Panel panel = getControlPanel(controlGroup);
dynamicControlPanel.removeAll();
dynamicControlPanel.add(panel, "pos 0 0");
dynamicControlPanel.revalidate();
}
prevTree = treePanel;
treePanel = treePanels.get(getPlan());
if (treePanel == null) {
treePanel = new LE_TreePlanPanel(this, getPlan());
treePanels.put(getPlan(), treePanel);
}
if (prevTree != treePanel) {
resetTree();
}
// resetComponents();
super.refresh();
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class LE_PlanPanel method resetComponents.
private void resetComponents() {
int treeHeight = LE_TreePlanPanel.ROW_HEIGHT * LE_TreePlanPanel.ROWS_DISPLAYED;
treeHolder.setPanelSize(new Dimension(VISUALS.PLAN_PANEL_FRAME.getWidth() - 50, treeHeight));
removeAll();
add(treeHolder, "id tree, pos 60 90");
add(new G_Panel(VISUALS.DRAGON_DIVIDER_SMALL), "id d, pos 52 tree.y2");
add(dynamicControlPanel, "id dcp, pos 67 d.y2+4");
add(new G_Panel(VISUALS.DRAGON_DIVIDER_SMALL), "id d2, pos 52 dcp.y2");
add(controlPanel, "id controlPanel, pos 67 d2.y2+4");
revalidate();
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class LE_TreePlanPanel method getBlockComponent.
private Component getBlockComponent(String iconPath, String labelText, boolean selected) {
// cache?
G_Panel comp = new G_Panel();
// extract to m
ImageIcon icon = ImageManager.getIcon(iconPath);
JLabel comp2 = new JLabel(icon);
comp.add(comp2, "id lbl");
JLabel comp3 = new JLabel(labelText);
comp3.setForeground(ColorManager.GOLDEN_WHITE);
comp.add(comp3, "x lbl.x2+4");
if (selected) {
// comp3.setBackground(ColorManager.GOLDEN_WHITE);
// comp3.setForeground(ColorManager.OBSIDIAN);
comp3.setBackground(ColorManager.PURPLE);
comp3.setForeground(ColorManager.GOLDEN_WHITE);
comp3.setOpaque(true);
}
// text name?
return comp;
}
Aggregations