use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class T3UpperPanel method init.
public void init() {
heroPortrait = new PortraitComp(hero);
controlPanel = new G_Panel();
for (final String c : controls) {
controlPanel.add(new CustomButton(VISUALS.BUTTON_NEW_TINY, (c)) {
public void handleClick() {
handleControl(c, false);
}
@Override
public void handleAltClick() {
handleControl(c, true);
}
});
}
add(controlPanel, "id cp, pos @center_x 0");
add(heroPortrait.getComp(), "pos @center_x cp.y2");
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class MapObjComp method initComp.
protected void initComp() {
d = getDimension();
Image image = getImage();
label = new JLabel(new ImageIcon(image));
G_Panel imgPanel = new G_Panel(label);
// TODO pos for symbol vs image
comp.add(imgPanel);
comp.setPanelSize(d);
comp.addMouseListener(this);
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class MapComp method refresh.
public void refresh() {
// re-evaluate available Routes
getComp().removeAll();
G_Panel backgroundComp = getBackgroundComp();
// ++ border of sorts?
getComp().add(backgroundComp);
if (listener != null) {
backgroundComp.addMouseListener(listener);
}
index = 0;
if (playerPartyComp == null) {
playerPartyComp = new PartyComp(getParty());
}
Coordinates ppp = getPlayerPartyPoint();
getComp().add(playerPartyComp.getComp(), "pos " + ppp.x + " " + ppp.y);
comp.setComponentZOrder(playerPartyComp.getComp(), index);
index++;
resetVisiblePlaces();
resetDisplayedRoutes();
for (Coordinates p : routes.keySet()) {
// ++ refresh
RouteComp routeComp = routes.get(p);
add(routeComp, "pos " + p.x + " " + p.y);
routeComp.refresh();
}
for (Coordinates p : places.keySet()) {
// ++ symbol if not available?
PlaceComp placeComp = places.get(p);
// Selectable?
getComp().add(placeComp.getComp(), "pos " + p.x + " " + p.y);
comp.setComponentZOrder(placeComp.getComp(), index);
index++;
placeComp.refresh();
}
comp.setComponentZOrder(backgroundComp, index);
addSpecialIcons();
// Route route = getParty().getCurrentRoute();
// if (route != null) {
// getComp().add(
// route.getComp().getComp(),
// "pos " + route.getMapPoint().x + " "
// + route.getMapPoint().y);
// }
// only display the active route if traveling!
getComp().revalidate();
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class GenericListChooser method initPanel.
protected void initPanel() {
panel = new G_Panel();
// if (list == null)
initList();
JScrollPane scroll = new JScrollPane(list);
int height = getPanelHeight();
int width = getPanelWidth();
panel.setPanelSize(new Dimension(width, height));
String listPanelHeight = height + "-40";
scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
panel.add(scroll, "id list1, pos 0 0, h " + listPanelHeight + "!");
if (secondList != null) {
JScrollPane scroll2 = new JScrollPane(secondList);
scroll2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
panel.add(scroll2, "id list2, pos list1.x2+50 0, h " + listPanelHeight + "!");
// panel.add(buttonPanel, "id bp, pos 0 " + listPanelHeight);
panel.add(buttonPanel, "id bp, pos 0 list2.y2");
} else {
// list.addMouseListener(listener);
}
if (tooltipMap == null) {
tooltipMap = map;
map = null;
}
toolTipPanel = new TextComp() {
@Override
protected Color getColor() {
return Color.black;
}
};
panel.add(toolTipPanel, "id tp, pos ip.x @max_y");
toolTipMainPanel = new TextComp(tooltip) {
@Override
protected Color getColor() {
return Color.black;
}
};
panel.add(toolTipMainPanel, "id tmp, pos @max_x+(max_x*(-3)) 0");
if (decorator == null) {
decorator = panelDecorator;
panelDecorator = null;
}
if (decorator != null) {
decorator.addComponents(panel);
}
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class OptionDialog method createComponent.
@Override
public Component createComponent() {
panel = new G_Panel(getVisuals());
if (vertical) {
panel.setLayout(new MigLayout("fillx, flowy"));
} else {
panel.setLayout(new MigLayout("fillx"));
}
// panel.add(new TextComp(null, title), "");
for (Object o : options) {
addButton(o);
}
WrappedTextComp comp = new WrappedTextComp(null, true) {
protected int getDefaultFontSize() {
return 16;
}
public void wrapTextLines() {
super.wrapTextLines();
}
protected Dimension initDefaultSize() {
return getPanelSize();
}
public Dimension getPanelSize() {
return new Dimension(OptionDialog.this.getVisuals().getWidth() - 42, OptionDialog.this.getVisuals().getHeight() - VISUALS.BUTTON.getHeight() - 32);
}
};
comp.setPanelSize(new Dimension(getVisuals().getWidth() - 42, getVisuals().getHeight() - VISUALS.BUTTON.getHeight() - 32));
comp.setText(title);
comp.refresh();
panel.add(comp, "@pos center_x 75");
return panel;
}
Aggregations