use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class WrappedContainer method refresh.
@Override
public void refresh() {
clearCustomComps();
removeAll();
resetComps();
addCustomComps();
spaceTaken = 0;
int i = 0;
estimateSizes();
for (G_Panel sub : comps) {
G_Panel comp = customComps.get(i);
if (comp != null) {
spaceTaken = addComp(comp, true);
}
spaceTaken = addComp(sub, false);
i++;
}
// panelSize = new Dimension(width, height);
refreshComponents();
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class MiniGrid method init.
public void init() {
// another canvas?
comp = new G_Panel();
comp.addMouseWheelListener(mouseWheelListener);
comp.addMouseMotionListener(mouseMotionListener);
// comp.addMouseListener(customMouseListener);
LogMaster.log(1, getComp().getMouseListeners() + " on " + getComp().hashCode());
// comp.addMouseMotionListener(new DragOffsetMouseListener(this));
setCellWidth((int) (getSize().getWidth() / dungeon.getCellsX()));
cellHeight = (int) (getSize().getHeight() / dungeon.getCellsY());
// maximum possible size for square dimensions
setCellWidth(Math.min(getCellWidth(), cellHeight));
originalCellWidth = cellWidth;
cellHeight = Math.min(getCellWidth(), cellHeight);
originalCellHeight = cellHeight;
overlayingObjHeight = cellHeight / 3 * 2;
overlayingObjWidth = getCellWidth() / 3 * 2;
resetDefaultOffset();
resetComponents();
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class DebugPanel method initGUI.
private void initGUI() {
// KEY LISTENER!
logPanel = new G_LogPanel();
buttonPanel = new FunctionPanel(master);
inputPanel = new G_InputPanel();
ip = new DC_InfoPanel(null, null, DC_Game.game.getState());
G_Panel panel = new G_Panel();
panel.setBackground(ColorManager.getTranslucent());
panel.setOpaque(false);
panel.add(ip, "id ip, pos 0 0");
panel.add(buttonPanel, "id btns, pos ip.x2 0");
frame.add(panel);
// setUndecorated(true);
// setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
frame.setSize(new Dimension(getPanelWidth(), getPanelHeight()));
frame.setVisible(true);
frame.addWindowListener(new WindowListener() {
@Override
public void windowOpened(WindowEvent e) {
}
@Override
public void windowIconified(WindowEvent e) {
}
@Override
public void windowDeiconified(WindowEvent e) {
}
@Override
public void windowDeactivated(WindowEvent e) {
}
@Override
public void windowClosing(WindowEvent e) {
}
@Override
public void windowClosed(WindowEvent e) {
frame.setVisible(false);
}
@Override
public void windowActivated(WindowEvent e) {
}
});
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class MainMenu method init.
private void init() {
panelSize = (GuiManager.DEF_DIMENSION);
setBackground(Color.black);
setOpaque(true);
itemPanel = new G_Panel(FRAME);
X = (GuiManager.DEF_DIMENSION.getWidth() - VISUALS.MENU_ITEM.getWidth()) / 2;
Y = (int) ((GuiManager.DEF_DIMENSION.getHeight() - FRAME.getHeight()) / 2);
itemPanel.setPanelSize(FRAME.getSize());
add(itemPanel, "pos " + X + " " + Y);
}
Aggregations