use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class ButtonChoicePanel method init.
private void init() {
panel = new G_Panel(getPanelVisuals());
panel.setMigLayout(getArgs());
int i = 0;
// G_Panel buttonPanel = new G_Panel("flowy");
for (String l : listData) {
String pos = "";
i++;
if (i >= wrap) {
pos = "wrap";
columns++;
i = 0;
}
panel.add(createButton(l), pos);
// buttonPanel.add(createButton(l), pos);
}
// panel.setVisuals(getPanelVisuals());
// panel.add(buttonPanel, "pos 40 40");
SIZE = getPanelVisuals().getSize();
// new Dimension(columnWidth *columns,Math.max(columns*wrap, i)*
// getVisuals().getHeight());
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class BfGridComp method initPanel.
private void initPanel() {
// GuiEventManager.trigger(GRID_CREATED, new OnDemandEventCallBack<>(
// new ImmutablePair<>(getCellsX(), getCellsY())));
panel = new G_Panel() {
protected void paintComponent(Graphics g) {
// Chronos
game.getAnimationManager().paintCalledOnBfGrid();
if (paintImage == null) {
return;
}
g.drawImage(paintImage, 0, 0, null);
if (!isLevelEditor()) {
game.getAnimationManager().drawAnimations(g);
}
// if (isOffsetIsNotReady()) {
// offsetIsNotReady = false;
// main.system.auxiliary.LogMaster
// .log(1,
// "!!isOffsetIsNotReadyisOffsetIsNotReadyisOffsetIsNotReadyisOffsetIsNotReady ");
// return;
// }
// main.system.auxiliary.LogMaster.log(1,
// "+++ paintComponent ");
}
};
panel.setPanelSize(new Dimension(getWidth(), getHeight()));
bfMouseListener = new BfMouseListener(this);
panel.addMouseListener(bfMouseListener);
if (customMouseListener != null) {
panel.addMouseListener(customMouseListener);
}
panel.addMouseMotionListener(bfMouseListener);
panel.addMouseWheelListener(bfMouseListener);
panel.setIgnoreRepaint(true);
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class DC_TopPanel method toggleDebugGui.
public void toggleDebugGui() {
refresh();
if (debugGui == null) {
debugGui = new DebugGui();
}
debugOn = !debugOn;
G_Panel removed = !debugOn ? debugGui : topComp;
G_Panel added = debugOn ? debugGui : topComp;
remove(removed);
add(added);
add(added, !debugOn ? "pos " + xOffset + " 0" + ", id top" : "pos 0 0");
if (debugOn) {
setPanelSize(new Dimension(debugGui.getPanelSize()));
}
// else
// setPanelSize(topComp.getVisuals().getSize());
setComponentZOrder(button, 0);
setComponentZOrder(added, 1);
revalidate();
repaint();
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class GatewayWindow method initButtonPanel.
private G_Panel initButtonPanel() {
int i = 0;
G_Panel buttonPanel = new G_Panel(" ");
buttonPanel.setPanelSize(new Dimension(GuiManager.getScreenWidthInt(), 64));
for (String command : GatewayButtonHandler.BUTTONS) {
command = StringMaster.getWellFormattedString(command);
JButton btn = new JButton(command);
String pos = "";
i++;
// if (i >= wrapButtons) {
// i = 0;
// pos = "wrap";
// }
buttonPanel.add(btn, pos);
btn.setActionCommand(command);
btn.addActionListener(buttonHandler);
}
return buttonPanel;
}
use of main.swing.generic.components.G_Panel in project Eidolons by IDemiurge.
the class SessionWindow method init.
public void init() {
panel = new G_Panel("flowy");
sessionControlPanel = new SessionControlPanel(session);
String pos = "pos 0 0, id sessionControlPanel";
panel.add(sessionControlPanel, pos);
timer = new SessionTimer(session, session.getIntParam(AT_PARAMS.SESSION_TIME));
// pos = "pos @center_x directionHeader.y2, id timer";
pos = "pos 0 sessionControlPanel.y2, id timer";
panel.add(timer, pos);
// timer.x2
boxPanel = new G_Panel();
pos = "pos @center_x-125 directionHeader.y2-30, id boxPanel";
panel.add(boxPanel, pos);
directionBox = initBox(getDirections(), "Direction");
styleBox = initBox(WORK_STYLE.values(), "Style");
stateBox = initBox(STATE.values(), "State");
viewBox = initBox(VIEW_OPTION.values(), "Custom View");
directionHeader = new DirectionHeader(session);
pos = "pos 0 sessionControlPanel.y2, id directionHeader";
panel.add(directionHeader, pos);
goalsPanel = new GoalPages(session);
pos = "pos 0 timer.y2, id goalsPanel";
panel.add(goalsPanel, pos);
infoPanel = new InfoEditPanel();
pos = "pos goalsPanel.x2 directionHeader.y2+50, id infoPanel";
panel.add(infoPanel.getPanel(), pos);
lockButton = new CustomButton(VISUALS.LOCK) {
@Override
public VISUALS getVisuals() {
return session.isLocked() ? VISUALS.LOCK : VISUALS.UNLOCK;
}
@Override
public void handleClick() {
session.setLocked(!session.isLocked());
refresh();
}
};
pos = "pos timer.x+85 timer.y2-50, id lockButton";
panel.add(lockButton, pos);
panel.refreshComponents();
}
Aggregations