use of main.swing.generic.components.misc.GraphicComponent in project Eidolons by IDemiurge.
the class G_ScrolledPanel method addArrows.
protected void addArrows(final boolean forward) {
String y;
String x;
// if (forward) {
y = vertical ? "" + spaceTaken : "center_y@";
x = !vertical ? "" + spaceTaken : "center_x@";
// } else {
// y = vertical ? "0" : "center_y@";
// x = !vertical ? "0" : "center_x@";
// }
String pos = "pos " + x + " " + y;
GraphicComponent arrow = new GraphicComponent(getArrowImage(forward));
arrow.addMouseListener(new MouseClickListener() {
public void mouseClicked(MouseEvent arg0) {
arrowPressed(forward);
}
});
add(arrow, pos);
spaceTaken += (vertical ? getArrowImage(true).getHeight(null) : getArrowImage(true).getWidth(null));
}
use of main.swing.generic.components.misc.GraphicComponent in project Eidolons by IDemiurge.
the class AddRemoveComponent method addComps.
protected void addComps() {
addBuffComps();
if (CharacterCreator.getInfoSelected() != null) {
if (CharacterCreator.getInfoSelected().getOBJ_TYPE_ENUM() == DC_TYPE.ACTIONS) {
addIconComps();
return;
}
}
addPools();
addIconComps();
if (!isBuffPanelNeeded(upperPanel.getEntity())) {
add(new GraphicComponent(VISUALS.ADD_REMOVE.getImage()), "id arc, pos " + FULL_WIDTH + "/2-" + VISUALS.ADD_REMOVE.getWidth() + "/2 " + GuiManager.getSmallObjSize());
}
addRemoveComp();
addAddComp();
}
use of main.swing.generic.components.misc.GraphicComponent in project Eidolons by IDemiurge.
the class HC_PointComp method addComps.
protected void addComps() {
if (icon != null) {
// pos
add(icon, "id icon, pos " + getIconOffsetX() + " " + getIconOffsetY());
// 6
// 6");
setComponentZOrder(icon, getComponentCount() - 1);
}
if (isLocked()) {
if (lock == null) {
lock = new GraphicComponent(STD_COMP_IMAGES.LOCK);
lock.addMouseListener(this);
}
add(lock, "id lock, pos c.x2+" + StringMaster.wrapInParenthesis("" + (getArrowOffsetX() - arrowWidth)) + " " + getArrowOffsetY() * 3 / 2);
setComponentZOrder(lock, getComponentCount() - 1);
} else if (editable) {
add(upArrow, "id ua, pos c.x2+" + StringMaster.wrapInParenthesis("" + (getArrowOffsetX() - arrowWidth)) + " " + getArrowOffsetY());
setComponentZOrder(upArrow, getComponentCount() - 1);
add(downArrow, "id da, pos c.x2+" + StringMaster.wrapInParenthesis("" + (getArrowOffsetX() - arrowWidth)) + " ua.y2");
setComponentZOrder(downArrow, getComponentCount() - 1);
}
add(textComp, "id c, pos 0 0");
setComponentZOrder(textComp, getComponentCount() - 1);
}
use of main.swing.generic.components.misc.GraphicComponent in project Eidolons by IDemiurge.
the class HeroPanel method addComps.
private void addComps() {
add(header, "id header, pos " + X_OFFSET + " " + Y_OFFSET);
if (deityMode) {
if (deityComp == null) {
deityComp = new JLabel(hero.getDeity().getType().getIcon());
}
add(deityComp, "id dc, pos header.x+12 header.y2");
add(infoPanel, "id ip, pos header.x dc.y2");
infoPanel.setEntity(hero.getDeity());
infoPanel.refresh();
return;
}
TextCompDC xpText = new TextCompDC(null, "Level " + hero.getLevel()) {
protected Font getDefaultFont() {
return FontMaster.getFont(FONT.AVQ, 18, Font.BOLD);
}
};
add(xpText, "@id xpText, pos center_x header.y2-6");
add(new GraphicComponent(ImageManager.getValueIcon(PARAMS.XP), "Experience"), "@id xpIcon, pos 52 xpText.y2-30");
xpBar.refresh();
add(xpBar, "id xpBar, pos xpIcon.x2-2 xpText.y2-17");
add(new GraphicComponent(ImageManager.getValueIcon(PARAMS.INTEGRITY), "integrity"), "@id integrityIcon, pos 52 xpBar.y2-3");
integrityBar.refresh();
add(integrityBar, "id integrityBar, pos integrityIcon.x2-2 xpBar.y2");
TextCompDC integrityText = new TextCompDC(null, "", 16) {
protected String getText() {
return IntegrityRule.getDescription(hero);
}
};
add(integrityText, "@id integrityText, pos center_x integrityBar.y2");
// xp label
add(buffPanel, "id buffs, pos header.x integrityText.y2");
add(infoPanel, "id ip, pos header.x buffs.y2");
infoPanel.setEntity(selectedObj != null ? selectedObj : hero);
infoPanel.refresh();
add(values, "id center, pos header.x ip.y2");
}
use of main.swing.generic.components.misc.GraphicComponent in project Eidolons by IDemiurge.
the class ChoicePanel method addItemComp.
private void addItemComp(T t, int n) {
Image img = getImage(t);
GraphicComponent comp = new GraphicComponent(img);
comp.setDataObject(t);
int x = getX(n);
int y = getY(n);
compMap.put(comp, new Point(x, y));
mouseMap.put(new Rectangle(getLocation().x + x, getLocation().y + y, getObjWidth(), getObjHeight()), t);
}
Aggregations