use of main.swing.generic.components.misc.GraphicComponent in project Eidolons by IDemiurge.
the class CustomList method updateDisplayImage.
private void updateDisplayImage() {
// TODO
displayImage = ImageManager.getNewBufferedImage(getWidth(), getHeight());
int n = 0;
for (E e : getData()) {
Component comp = comps.get(n);
int h = comp.getWidth();
int w = comp.getHeight();
Point p = getIndexPosition(n);
n++;
int x = p.x;
int y = p.y;
Image image;
if (comp instanceof ListItem) {
ListItem listItem = (ListItem) comp;
listItem.refresh();
if (listItem.getIcon() == null) {
continue;
}
image = listItem.getImage();
} else if (comp instanceof GraphicComponent) {
GraphicComponent graphicComponent = (GraphicComponent) comp;
image = graphicComponent.getImg();
} else {
if (w == 0) {
w = 64;
}
if (h == 0) {
h = 64;
}
image = ImageManager.getNewBufferedImage(w, h);
Graphics g = image.getGraphics();
comp.paintAll(g);
mouseMap.put(new Rectangle(x, y, w, h), e);
displayImage.getGraphics().drawImage(image, x, y, null);
continue;
}
w = image.getWidth(null);
h = image.getHeight(null);
mouseMap.put(new Rectangle(x, y, w, h), e);
displayImage.getGraphics().drawImage(image, x, y, null);
}
}
use of main.swing.generic.components.misc.GraphicComponent in project Eidolons by IDemiurge.
the class HT_View method initTabPanel.
protected HC_TabPanel initTabPanel(List<HC_Tab> tabList) {
HC_TabPanel tabPanel = new HC_TabPanel(tabList) {
@Override
public void notifyListener() {
listener.tabSelected(getSelectedTabName());
}
@Override
public Component generateEmptyTabComp() {
return new GraphicComponent(ImageManager.getNewBufferedImage(getTabCompWidth(), getTabCompHeight()));
}
@Override
protected STD_SOUNDS getClickSound() {
return STD_SOUNDS.ON_OFF;
// return STD_SOUNDS.DIS__OPEN_MENU;
}
@Override
public Component getSelectedTabComponent() {
return super.getSelectedTabComponent();
}
@Override
public ComponentVisuals getTAB() {
// empty
if (TAB == null) {
TAB = new CompVisuals(ImageManager.getNewBufferedImage(getTabCompWidth(), getTabCompHeight()));
}
return TAB;
}
public int getPageSize() {
return getTabPageSize();
}
};
tabPanel.setChangeListener(this);
return tabPanel;
}
use of main.swing.generic.components.misc.GraphicComponent in project Eidolons by IDemiurge.
the class StatsControlComponent method addComps.
protected void addComps() {
add(mstrPanel, "id mstrPanel, pos 0 0");
add(attrPanel, "id attrPanel, pos 0 mstrGoldCostPool.y2");
add(buyAttrXP, "id buyAttrXP, pos 0 mstrPanel.y2");
add(attrXpCostPool, "id attrXpCostPool, pos buyAttrXP.x2 mstrPanel.y2");
add(xpPool, "id xpPool, pos attrXpCostPool.x2 mstrPanel.y2");
add(new GraphicComponent(STD_COMP_IMAGES.XP), "id xp, pos attrXpCostPool.x2+" + (xpPool.getVisuals().getWidth() - STD_COMP_IMAGES.XP.getWidth()) / 2 + " mstrPanel.y2+" + STD_COMP_IMAGES.XP.getHeight());
add(mstrXpCostPool, "id mstrXpCostPool, pos xpPool.x2 mstrPanel.y2");
add(buyMstrXP, "id buyMstrXP, pos mstrXpCostPool.x2 mstrPanel.y2");
add(attrPool, "id attrPool, pos 0 " + Y_POINTS);
add(mstrPool, "id mstrPool, pos " + (attrPanel.getVisuals().getWidth() - mstrPool.getVisuals().getWidth()) + " " + Y_POINTS);
add(okButton, "id okButton, pos " + MigMaster.getCenteredPosition(attrPanel.getVisuals().getWidth(), okButton.getVisuals().getWidth() * 2) + " " + (Y_POINTS - 15));
add(cancelButton, "id cancelButton, pos okButton.x2 " + (Y_POINTS - 15));
add(buyAttrGold, "id buyAttrGold, pos 0 " + Y_GOLD);
add(attrGoldCostPool, "id attrGoldCostPool, pos buyAttrGold.x2 " + Y_GOLD);
add(goldPool, "id goldPool, pos attrGoldCostPool.x2 " + Y_GOLD);
add(new GraphicComponent(STD_COMP_IMAGES.GOLD), "id gold, pos attrGoldCostPool.x2+" + (goldPool.getVisuals().getWidth() - STD_COMP_IMAGES.GOLD.getWidth()) / 2 + " " + (Y_GOLD - STD_COMP_IMAGES.GOLD.getHeight()));
add(mstrGoldCostPool, "id mstrGoldCostPool, pos goldPool.x2 " + Y_GOLD);
add(buyMstrGold, "id buyMstrGold, pos mstrGoldCostPool.x2 " + Y_GOLD);
}
use of main.swing.generic.components.misc.GraphicComponent in project Eidolons by IDemiurge.
the class PrincipleMiddlePanel method init.
public void init() {
add(new GraphicComponent(STD_IMAGES.GUARDIAN), "@pos 0 max_bottom");
add(new GraphicComponent(ImageTransformer.flipHorizontally(ImageManager.getBufferedImage(STD_IMAGES.GUARDIAN.getImage()))), "@pos max_right max_bottom");
integrityBar = new SpecialValueBar(false, PARAMS.INTEGRITY);
integrityBar.setObj(hero);
rpgDescription = new TextCompDC(null, "", 18, FONT.AVQ);
bonusTextComp = new WrappedTextComp(null, false);
bonusTextComp.setPanelSize(new Dimension(250, 170));
add(integrityBar, "@id bar, pos center_x 0");
add(bonusTextComp, "@id text, pos center_x rpg.y2");
}
use of main.swing.generic.components.misc.GraphicComponent in project Eidolons by IDemiurge.
the class MapComp method addSpecialIcons.
private void addSpecialIcons() {
Place dest = MacroGame.getGame().getPlayerParty().getCurrentDestination();
if (dest != null) {
Coordinates c = new Coordinates(true, dest.getCoordinates().x + DEST_OFFSET_X, dest.getCoordinates().y + DEST_OFFSET_Y);
add(new GraphicComponent(STD_IMAGES.FLAG), c);
}
Place lastLocation = MacroGame.getGame().getPlayerParty().getLastLocation();
if (lastLocation != null) {
Coordinates c = new Coordinates(true, lastLocation.getCoordinates().x + LAST_OFFSET_X, lastLocation.getCoordinates().y + LAST_OFFSET_Y);
add(new GraphicComponent(STD_IMAGES.FOOT), c);
}
// last battle to be displayed?
// cities - special comps? select icon-mode - display known taverns,
// shop, ...
// ++ active route should be enlarged or so...
}
Aggregations