use of eidolons.client.cc.gui.pages.HC_PagedListPanel in project Eidolons by IDemiurge.
the class SkillTabNew method resetComps.
public void resetComps() {
if (isReinitDataRequired() || isDirty()) {
initData();
}
int i = 0;
for (HC_PagedListPanel pagedListPanel : listPages) {
ArrayList<ObjType> data = getData(SKILL_DISPLAY_GROUPS.values()[i]);
i++;
pagedListPanel.setData(data);
pagedListPanel.initPages();
getItemManager().add(pagedListPanel);
pagedListPanel.refresh();
if (pagedListPanel.getParent() == null) {
addComps();
}
}
}
use of eidolons.client.cc.gui.pages.HC_PagedListPanel in project Eidolons by IDemiurge.
the class SkillTabNew method addComps.
protected void addComps() {
iconColumns = new ArrayList<>();
int i = 0;
int w = getTemplate().getTemplate().getVisuals().getWidth();
int h = getTemplate().getTemplate().getVisuals().getHeight();
for (HC_PagedListPanel pagedListPanel : listPages) {
String constraints = "id " + LIST_ID + i + ", " + "pos " + offsetX + " " + h * i + "+" + getMainPosY();
add(pagedListPanel, constraints);
MasteryIconColumn icons = new MasteryIconColumn(hero, SKILL_DISPLAY_GROUPS.values()[i]);
constraints = "pos " + (offsetX + w + 3) + " " + (h * i) + "-2";
add(icons, constraints);
iconColumns.add(icons);
i++;
if (getItemManager() != null) {
getItemManager().add(pagedListPanel);
}
}
}
use of eidolons.client.cc.gui.pages.HC_PagedListPanel in project Eidolons by IDemiurge.
the class ItemListManager method mouseClicked.
@Override
public void mouseClicked(MouseEvent e) {
boolean alt = e.isAltDown();
boolean right = SwingUtilities.isRightMouseButton(e);
JList<ObjType> list = (JList<ObjType>) e.getSource();
HeroListPanel hlp = (HeroListPanel) list.getParent();
ObjType type = list.getSelectedValue();
if (right && e.getClickCount() == 1) {
if (isRemovable((HC_PagedListPanel) hlp.getParent()) || (!getHero().getGame().isSimulation() && PROP == PROPS.INVENTORY)) {
removeType(type, hlp, isAltProp(hlp) ? prop2 : PROP);
DC_SoundMaster.playStandardSound(getRemoveSound(type.getOBJ_TYPE_ENUM()));
// coins clink! failed to parse xml
return;
}
}
// double right click won't work for ITEMS!
if (right && e.getClickCount() > 1) {
alt = true;
}
if (alt || e.getClickCount() > 1) {
if (addType(type, hlp, alt)) {
DC_SoundMaster.playStandardSound(getAddSound(type.getOBJ_TYPE_ENUM()));
} else {
failedAddType(type);
}
} else {
typeSelected(type, hlp);
DC_SoundMaster.playStandardSound(STD_SOUNDS.MODE);
}
}
use of eidolons.client.cc.gui.pages.HC_PagedListPanel in project Eidolons by IDemiurge.
the class ShopListsPanel method initListMap.
// to be used
public Map<String, HC_PagedListPanel> initListMap(String tabName) {
if (!Launcher.getMainManager().isMacroMode()) {
return super.initListMap(tabName);
}
if (getTown() == null) {
return new HashMap<>();
}
Map<String, HC_PagedListPanel> map = new XLinkedMap<>();
List<ObjType> items = new ArrayList<>();
Shop shop = getShop(tabName);
shop.setVendorPanel(this);
for (ObjType t : shop.getItems()) {
items.add(t);
}
for (String group : getListGroup(tabName)) {
List<ObjType> data = new ArrayList<>();
for (ObjType t : items) {
if (checkType(t, group, shop)) {
data.add(t);
}
}
if (!data.isEmpty()) {
putList(group, data, map);
}
}
// sorting?
return map;
}
use of eidolons.client.cc.gui.pages.HC_PagedListPanel in project Eidolons by IDemiurge.
the class VendorListsPanel method putList.
protected void putList(String listName, List<ObjType> data, Map<String, HC_PagedListPanel> map) {
HC_PagedListPanel list = // vertical, rowsPerList, itemSize, data);
new HC_PagedListPanel(HC_LISTS.VENDOR, hero, manager, data, listName);
list.setTYPE(TYPE);
list.setBorderChecker(getBorderChecker());
map.put(listName, list);
manager.add(list);
}
Aggregations