use of eidolons.swing.components.panels.page.log.WrappedTextComp in project Eidolons by IDemiurge.
the class HC_PointView method addComps.
private void addComps() {
paramBonusInfoComp = new WrappedTextComp(null, // VISUALS.OPTION_PANEL_3
false) {
@Override
public Dimension getPanelSize() {
return new Dimension(400, 140);
}
};
// wtc.setPanelSize(size)
paramBonusInfoComp.setDefaultSize(new Dimension(400, getDefaultY() - 15));
paramBonusInfoComp.setDefaultFont(FontMaster.getFont(FONT.AVQ, 18, Font.PLAIN));
// centering?
add(paramBonusInfoComp, "id wtc, pos " + 0 + " " + 0);
add(new GraphicComponent(VISUALS.DRAGON_DIVIDER.getImage()), "id div, @pos center_x+24 wtc.y2-24");
// DIVIDER
X = getDefaultX();
Y = getDefaultY();
i = 0;
if (!attributes) {
if (editable) {
DC_ContentManager.sortMasteries(hero, params);
}
}
for (PARAMETER p : params) {
boolean editable = isEditable(p);
HC_PointComp comp = new HC_PointComp(editable, hero, buffer, p, (attributes) ? PARAMS.ATTR_POINTS : PARAMS.MASTERY_POINTS);
addComponent(comp, p);
}
}
use of eidolons.swing.components.panels.page.log.WrappedTextComp in project Eidolons by IDemiurge.
the class UnitGroupMaster method chooseUnit.
private static ObjType chooseUnit(ObjType factionType, int power, int max_power) {
Map<ObjType, Integer> pool = initPool(factionType);
List<ObjType> available = new ArrayList<>();
for (ObjType l : pool.keySet()) {
if (getUnitCost(l, factionType) > power) {
continue;
}
if (l.getIntParam(PARAMS.POWER) > max_power) {
continue;
}
available.add(l);
}
if (available.isEmpty()) {
return null;
}
// chooseUnit();
Map<String, String> map = new HashMap<>();
for (ObjType type : pool.keySet()) {
map.put(type.getName(), "Cost: " + pool.get(type) + "; Power: " + type.getIntParam(PARAMS.POWER));
}
ListChooser.setDecorator(new Decorator() {
@Override
public void addComponents(G_Panel panel) {
G_ListPanel<ObjType> list = // new CustomList<>(getUnitList());
new G_ListPanel<ObjType>(getUnitList()) {
@Override
public void setInts() {
wrap = 1;
minItems = max;
rowsVisible = 1;
layoutOrientation = JList.HORIZONTAL_WRAP;
}
@Override
public boolean isVertical() {
return false;
}
};
list.setPanelSize(new Dimension(300, 120));
panel.add(list, "pos tp.x decor_info.y2");
WrappedTextComp textComp = new WrappedTextComp(null) {
@Override
protected Color getColor() {
return Color.black;
}
@Override
public synchronized List<String> getTextLines() {
List<String> list = new ArrayList<>();
list.add(UnitGroupMaster.getRemainingPower() + " points remaining");
list.add("Size contraints: between " + min + " and " + max);
return list;
}
};
textComp.setDefaultSize(new Dimension(300, 120));
panel.add(textComp, "id decor_info, pos tp.x tp.y2");
}
});
ListChooser.setTooltipMapForComponent(map);
ListChooser.setSortingDisabled(true);
return ListChooser.chooseType_(available, DC_TYPE.UNITS);
// gui - a list per ally
}
use of eidolons.swing.components.panels.page.log.WrappedTextComp in project Eidolons by IDemiurge.
the class PartyHeader method createComponents.
public void createComponents() {
locationComp = new WrappedTextComp(VISUALS.VALUE_BOX_BIG, true);
header = new Header(new ArrayList<>(Arrays.asList(party_params)), party);
add(locationComp, "@pos center_x 20, id lc");
add(header, "@pos center_x lc.y2, id header");
// status: en route, in town, at place, lost, in flight, in battle..
}
use of eidolons.swing.components.panels.page.log.WrappedTextComp 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 eidolons.swing.components.panels.page.log.WrappedTextComp in project Eidolons by IDemiurge.
the class TimeComp method init.
private void init() {
// ++ area/region?
removeAll();
// new GraphicComponent(date.isDay_or_night() ? STD_IMAGES.DAY.getImg()
// : STD_IMAGES.NIGHT.getImg());
textComp = new WrappedTextComp(VISUALS.VALUE_BOX_BIG) {
protected int getDefaultFontSize() {
return 17;
}
public void refresh() {
String line1 = "The " + StringMaster.getOrdinalEnding(date.getDay()) + (date.getMonth() != null ? " of " + date.getMonth() : "");
line1 = date.getShortString();
String line2 = date.getYear() + " of " + date.getEra();
line2 = date.getStringExtension();
textLines = new ListMaster<String>().getList(line1, line2);
super.refresh();
}
@Override
protected boolean isAutoWrapText() {
return false;
}
};
// textComp.setText(date.getShortString());
// textComp.setPanelSize(size);
add(textComp);
revalidate();
}
Aggregations