use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class SessionWindow method initBoxPanel.
private G_Panel initBoxPanel() {
G_Panel boxPanel = new G_Panel("flowy");
int i = 0;
for (Class c : comboBoxes) {
List<String> list = ListMaster.toStringList(true, null, c.getEnumConstants());
JComboBox<String> box = new JComboBox<>(list.toArray(new String[list.size()]));
// int x = 0, y = 0;
// String pos = "pos " + x + " " + y;
String pos = "";
i++;
if (i >= wrapComboBoxes) {
i = 0;
pos = "wrap";
}
boxPanel.add(box, pos);
}
return boxPanel;
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class EntityChoiceDialog method createComponent.
@Override
public Component createComponent() {
G_Panel comp = new G_Panel();
choicePanel = getChoicePanel();
CustomButton okButton = new CustomButton(VISUALS.OK) {
@Override
public void handleClick() {
ok();
}
};
CustomButton closeButton = new CustomButton(VISUALS.CANCEL) {
@Override
public void handleClick() {
WaitMaster.interrupt(getWaitOperation());
close();
}
};
comp.setOpaque(true);
comp.setBackground(ColorManager.BACKGROUND);
int x = choicePanel.getPanelWidth();
// n * getObjSize();
comp.add(choicePanel);
comp.add(okButton, "id ok, pos " + x + " 0");
comp.add(closeButton, "pos ok.x @max_bottom, id close");
// comp.add(list, "id list, pos 0 0");
comp.setPanelSize(getSize());
return comp;
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class OperationWindow method createComponent.
public Component createComponent() {
panel = new G_Panel(getVisuals());
operationsPool = new PoolComp(getPoolText(), getPoolTooltip(), false);
//
CustomButton okButton = new CustomButton(OK) {
public void handleClick() {
done();
}
protected boolean isMoreY() {
return true;
}
};
CustomButton cancelButton = new CustomButton(CANCEL) {
protected boolean isMoreY() {
return true;
}
public void handleClick() {
cancel();
}
};
panel.add(getComponent(), "id tab, pos " + GuiManager.PANEL_FRAME_WIDTH + " " + GuiManager.PANEL_FRAME_HEIGHT);
panel.add(okButton, "@id ok, pos max_right-" + GuiManager.PANEL_FRAME_WIDTH + " max_top-" + GuiManager.PANEL_FRAME_HEIGHT);
panel.add(cancelButton, "@id cancel, pos max_right-" + GuiManager.PANEL_FRAME_WIDTH + " ok.y2");
panel.add(operationsPool, "@id op, pos max_right-" + GuiManager.PANEL_FRAME_WIDTH + " cancel.y2");
panel.setBackground(ColorManager.BACKGROUND);
return panel;
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class T3InfoPanel method init.
public void init() {
Entity skill = null;
try {
skill = CharacterCreator.getHero().getSkills().get(flipped ? 1 : 0);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
infoPanel = new DC_PagedInfoPanel(skill);
ImageIcon icon = ImageManager.getEmptyItemIcon(flipped);
if (skill != null) {
icon = skill.getIcon();
}
label = new JLabel(icon);
controlPanel = new G_Panel();
controlPanel.setPanelSize(new Dimension(122, getPanelSize().height));
costPool = new PoolComp(skill, PARAMS.XP_COST, "Experience cost", false);
xpPool = new PoolComp(CharacterCreator.getHero(), PARAMS.XP, "Experience points", true) {
};
addComps();
}
use of main.swing.generic.components.G_Panel 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;
}
Aggregations