use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiTimer method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
Label label = new Label(mc, this).setText("Delay:");
speedField = new TextField(mc, this).setTooltips("Set the delay in ticks", "(20 ticks is one second)").addTextEvent((parent, newText) -> setDelay());
int delay = tileEntity.getDelay();
if (delay <= 0) {
delay = 1;
}
speedField.setText(String.valueOf(delay));
Panel bottomPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(label).addChild(speedField);
toplevel.addChild(bottomPanel);
redstonePauses = new ToggleButton(mc, this).setText("Pause while redstone active").setDesiredHeight(16).setCheckMarker(true).setPressed(tileEntity.getRedstonePauses()).addButtonEvent(parent -> setRedstonePauses());
toplevel.addChild(redstonePauses);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, TIMER_WIDTH, TIMER_HEIGHT));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiRedstoneReceiver method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
analog = new ToggleButton(mc, this).setText("Analog mode").setTooltips("Output the same power", "level as the input, instead", "of always 15 or 0").setCheckMarker(true).setDesiredWidth(160).setDesiredHeight(16).setPressed(tileEntity.getAnalog()).addButtonEvent(parent -> setAnalog());
toplevel.addChild(analog);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, REDSTONE_RECEIVER_WIDTH, REDSTONE_RECEIVER_HEIGHT));
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiComposer method initGui.
@Override
public void initGui() {
super.initGui();
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
getShapeRenderer().initView(getPreviewLeft(), guiTop + 100);
ShapeModifier[] modifiers = tileEntity.getModifiers();
operationLabels[0] = null;
for (int i = 0; i < ComposerContainer.SLOT_COUNT; i++) {
operationLabels[i] = new ChoiceLabel(mc, this).addChoices(ShapeOperation.UNION.getCode(), ShapeOperation.SUBTRACT.getCode(), ShapeOperation.INTERSECT.getCode());
for (ShapeOperation operation : ShapeOperation.values()) {
operationLabels[i].setChoiceTooltip(operation.getCode(), operation.getDescription());
}
operationLabels[i].setLayoutHint(new PositionalLayout.PositionalHint(55, 7 + i * 18, 26, 16));
operationLabels[i].setChoice(modifiers[i].getOperation().getCode());
operationLabels[i].addChoiceEvent((parent, newChoice) -> update());
toplevel.addChild(operationLabels[i]);
}
operationLabels[0].setEnabled(false);
for (int i = 0; i < ComposerContainer.SLOT_COUNT; i++) {
configButton[i] = new Button(mc, this).setText("?");
configButton[i].setLayoutHint(new PositionalLayout.PositionalHint(3, 7 + i * 18 + 2, 13, 12));
int finalI = i;
configButton[i].addButtonEvent(parent -> openCardGui(finalI));
configButton[i].setTooltips("Click to open the card gui");
toplevel.addChild(configButton[i]);
}
outConfigButton = new Button(mc, this).setText("?");
outConfigButton.setLayoutHint(new PositionalLayout.PositionalHint(3, 200 + 2, 13, 12));
outConfigButton.addButtonEvent(parent -> openCardGui(-1));
outConfigButton.setTooltips("Click to open the card gui");
toplevel.addChild(outConfigButton);
showAxis = ShapeGuiTools.createAxisButton(this, toplevel, 5, 176);
showOuter = ShapeGuiTools.createBoxButton(this, toplevel, 31, 176);
showScan = ShapeGuiTools.createScanButton(this, toplevel, 57, 176);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
Panel sidePanel = new Panel(mc, this).setLayout(new PositionalLayout()).setBackground(sideBackground);
String[] tt = { "Drag left mouse button to rotate", "Shift drag left mouse to pan", "Use mouse wheel to zoom in/out", "Use middle click to reset rotation" };
sidePanel.addChild(new Label<>(mc, this).setText("E").setColor(0xffff0000).setTooltips(tt).setLayoutHint(new PositionalLayout.PositionalHint(5, 175, 15, 15)));
sidePanel.addChild(new Label<>(mc, this).setText("W").setColor(0xffff0000).setTooltips(tt).setLayoutHint(new PositionalLayout.PositionalHint(40, 175, 15, 15)));
sidePanel.addChild(new Label<>(mc, this).setText("U").setColor(0xff00bb00).setTooltips(tt).setLayoutHint(new PositionalLayout.PositionalHint(5, 190, 15, 15)));
sidePanel.addChild(new Label<>(mc, this).setText("D").setColor(0xff00bb00).setTooltips(tt).setLayoutHint(new PositionalLayout.PositionalHint(40, 190, 15, 15)));
sidePanel.addChild(new Label<>(mc, this).setText("N").setColor(0xff0000ff).setTooltips(tt).setLayoutHint(new PositionalLayout.PositionalHint(5, 205, 15, 15)));
sidePanel.addChild(new Label<>(mc, this).setText("S").setColor(0xff0000ff).setTooltips(tt).setLayoutHint(new PositionalLayout.PositionalHint(40, 205, 15, 15)));
for (int i = 0; i < ComposerContainer.SLOT_COUNT; i++) {
ToggleButton flip = new ToggleButton(mc, this).setText("Flip").setCheckMarker(true).setLayoutHint(new PositionalLayout.PositionalHint(6, 7 + i * 18, 35, 16));
flip.setPressed(modifiers[i].isFlipY());
flip.addButtonEvent(parent -> update());
sidePanel.addChild(flip);
flipButtons[i] = flip;
ChoiceLabel rot = new ChoiceLabel(mc, this).addChoices("None", "X", "Y", "Z").setChoice("None").setLayoutHint(new PositionalLayout.PositionalHint(45, 7 + i * 18, 35, 16));
rot.setChoice(modifiers[i].getRotation().getCode());
rot.addChoiceEvent((parent, newChoice) -> update());
sidePanel.addChild(rot);
rotationLabels[i] = rot;
}
sidePanel.setBounds(new Rectangle(guiLeft - SIDEWIDTH, guiTop, SIDEWIDTH, ySize));
sideWindow = new Window(this, sidePanel);
window = new Window(this, toplevel);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiProjector method initSidePanel.
private void initSidePanel() {
Panel sidePanel = new Panel(mc, this).setLayout(new PositionalLayout()).setBackground(sideBackground);
initRsPanel(sidePanel, 0, "S");
initRsPanel(sidePanel, 1, "N");
initRsPanel(sidePanel, 2, "E");
initRsPanel(sidePanel, 3, "W");
sidePanel.setBounds(new Rectangle(guiLeft - SIDEWIDTH, guiTop, SIDEWIDTH, ySize));
sideWindow = new Window(this, sidePanel);
}
use of mcjty.lib.gui.Window in project RFTools by McJty.
the class GuiScanner method initGui.
@Override
public void initGui() {
super.initGui();
getShapeRenderer().initView(getPreviewLeft(), guiTop + 100);
Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
int maxEnergyStored = tileEntity.getMaxEnergyStored();
energyBar = new EnergyBar(mc, this).setHorizontal().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(8, 120, 70, 10)).setShowText(false);
energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
toplevel.addChild(energyBar);
initRedstoneMode();
toplevel.addChild(redstoneMode);
showAxis = ShapeGuiTools.createAxisButton(this, toplevel, 5, 176);
showOuter = ShapeGuiTools.createBoxButton(this, toplevel, 31, 176);
showScan = ShapeGuiTools.createScanButton(this, toplevel, 57, 176);
scanButton = new Button(mc, this).setText("Scan").addButtonEvent(parent -> scan()).setLayoutHint(new PositionalLayout.PositionalHint(5, 156, 40, 16));
toplevel.addChild(scanButton);
toplevel.addChild(new Button(mc, this).setText("W").addButtonEvent(parent -> move(-16, 0, 0)).setLayoutHint(new PositionalLayout.PositionalHint(4, 30, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("w").addButtonEvent(parent -> move(-1, 0, 0)).setLayoutHint(new PositionalLayout.PositionalHint(20, 30, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("e").addButtonEvent(parent -> move(1, 0, 0)).setLayoutHint(new PositionalLayout.PositionalHint(45, 30, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("E").addButtonEvent(parent -> move(16, 0, 0)).setLayoutHint(new PositionalLayout.PositionalHint(61, 30, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("S").addButtonEvent(parent -> move(0, 0, -16)).setLayoutHint(new PositionalLayout.PositionalHint(4, 50, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("s").addButtonEvent(parent -> move(0, 0, -1)).setLayoutHint(new PositionalLayout.PositionalHint(20, 50, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("n").addButtonEvent(parent -> move(0, 0, 1)).setLayoutHint(new PositionalLayout.PositionalHint(45, 50, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("N").addButtonEvent(parent -> move(0, 0, 16)).setLayoutHint(new PositionalLayout.PositionalHint(61, 50, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("D").addButtonEvent(parent -> move(0, -16, 0)).setLayoutHint(new PositionalLayout.PositionalHint(4, 70, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("d").addButtonEvent(parent -> move(0, -1, 0)).setLayoutHint(new PositionalLayout.PositionalHint(20, 70, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("u").addButtonEvent(parent -> move(0, 1, 0)).setLayoutHint(new PositionalLayout.PositionalHint(45, 70, 16, 15)));
toplevel.addChild(new Button(mc, this).setText("U").addButtonEvent(parent -> move(0, 16, 0)).setLayoutHint(new PositionalLayout.PositionalHint(61, 70, 16, 15)));
offsetLabel = new Label(mc, this).setText("Off: " + BlockPosTools.toString(tileEntity.getDataOffset())).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
offsetLabel.setLayoutHint(new PositionalLayout.PositionalHint(4, 90, 80, 14));
toplevel.addChild(offsetLabel);
dimensionLabel = new Label(mc, this).setText("Dim: " + BlockPosTools.toString(tileEntity.getDataDim())).setHorizontalAlignment(HorizontalAlignment.ALIGH_LEFT);
dimensionLabel.setLayoutHint(new PositionalLayout.PositionalHint(4, 105, 80, 14));
toplevel.addChild(dimensionLabel);
progressLabel = new Label(mc, this).setText("");
progressLabel.setLayoutHint(new PositionalLayout.PositionalHint(4, 135, 80, 14));
toplevel.addChild(progressLabel);
toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
window = new Window(this, toplevel);
move(0, 0, 0);
filterCnt = countFilters();
tileEntity.requestRfFromServer(RFTools.MODID);
}
Aggregations