use of main.swing.generic.components.G_Component in project Eidolons by IDemiurge.
the class ClassTreeView method initTabList.
@Override
protected List<HC_Tab> initTabList() {
List<HC_Tab> tabList = new ArrayList<>();
List<CLASS_GROUP> classes = new ArrayList<>(Arrays.asList(HeroEnums.CLASS_GROUP.values()));
// }
for (final CLASS_GROUP classGroup : classes) {
if (classGroup == HeroEnums.CLASS_GROUP.MULTICLASS) {
continue;
}
HC_Tab tab = tabMap.get(classGroup);
if (tab == null) {
G_Component comp = new G_Panel(getPanelVisuals()) {
public boolean isBackgroundVisuals() {
return !super.isBackgroundVisuals();
}
};
int index = 0;
tab = new HC_Tab(classGroup.getName(), comp, index) {
@Override
public Component generateTabComp(HC_TabPanel panel) {
return new GraphicComponent(ImageManager.getNewBufferedImage(isSelected() ? getSelectedTabCompWidth() : getTabCompWidth(), getTabCompHeight())) {
public Image getImg() {
boolean locked = !hasClass(classGroup);
try {
image = HC_Master.generateClassIcon(classGroup, isSelected(), locked, hero);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
image = ImageManager.getNewBufferedImage(getTabCompWidth(), getTabCompWidth());
}
setCompSize(new Dimension(image.getWidth(null), image.getHeight(null)));
return image;
}
};
}
};
}
tabList.add(tab);
tabMap.put(classGroup, tab);
}
return tabList;
}
use of main.swing.generic.components.G_Component 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_Component in project Eidolons by IDemiurge.
the class LE_Palette method addWorkspaceTab.
public void addWorkspaceTab(PaletteWorkspace ws) {
G_Component comp = new PagedPaletteTab(ws);
String string = ws.getImagePath();
if (imagePath == null) {
string = ws.getName();
}
paletteTabs.addTab(string, comp);
refresh();
}
use of main.swing.generic.components.G_Component in project Eidolons by IDemiurge.
the class HeroPanel method refresh.
@Override
public void refresh() {
if (!deityMode) {
for (G_Component c : comps) {
c.refresh();
}
}
removeAll();
addComps();
itemPanel.setObj(hero);
itemPanel.refresh();
revalidate();
}
use of main.swing.generic.components.G_Component in project Eidolons by IDemiurge.
the class G_PagePanel method initPages.
// public Dimension getMinimumSize() {
// return getPreferredSize();
// } //crops!..
public void initPages() {
resetData();
if (!isDirty() && (ListMaster.isNotEmpty(pages))) {
return;
}
pages = new ArrayList<>();
empty = false;
if (!ListMaster.isNotEmpty(pageData)) {
empty = true;
pages.add(createEmptyPageComponent());
setDirty(true);
} else {
createPageIndex = 0;
for (List<E> list : pageData) {
if (!ListMaster.isNotEmpty(list)) {
pages.add(createEmptyPageComponent());
} else {
G_Component pageComponent = createPageComponent(list);
createPageIndex++;
if (pageMouseListener != null) {
SwingMaster.addMouseListener(pageComponent, pageMouseListener);
// if (createPageComponent instanceof G_PagePanel) {
// G_PagePanel g_PagePanel = (G_PagePanel)
// createPageComponent;
// g_PagePanel.setPageMouseListener(pageMouseListener);
// } else
// createPageComponent
// .addMouseListener(pageMouseListener);
}
pages.add(pageComponent);
}
}
}
}
Aggregations