Search in sources :

Example 1 with Window

use of mcjty.lib.gui.Window in project RFToolsDimensions by McJty.

the class GuiDimensionEditor method initGui.

@Override
public void initGui() {
    super.initGui();
    int maxEnergyStored = tileEntity.getMaxEnergyStored();
    energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 7, 8, 54)).setShowText(false);
    energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
    arrow = new ImageLabel(mc, this).setImage(iconGuiElements, 192, 0);
    arrow.setLayoutHint(new PositionalLayout.PositionalHint(90, 26, 16, 16));
    destroy = new Label(mc, this).setColor(0xff0000);
    destroy.setText("Destroying dimension!");
    destroy.setLayoutHint(new PositionalLayout.PositionalHint(30, 53, 150, 16));
    destroy.setVisible(false);
    percentage = new Label(mc, this).setText("0%");
    percentage.setLayoutHint(new PositionalLayout.PositionalHint(80, 43, 40, 16));
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(arrow).addChild(percentage).addChild(destroy);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
    tileEntity.requestRfFromServer(RFToolsDim.MODID);
    tileEntity.requestBuildingPercentage();
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Label(mcjty.lib.gui.widgets.Label)

Example 2 with Window

use of mcjty.lib.gui.Window in project RFToolsDimensions by McJty.

the class GuiEssencePainter method initGui.

@Override
public void initGui() {
    super.initGui();
    extractButton = new Button(mc, this).setText("Extract").setLayoutHint(new PositionalLayout.PositionalHint(13, 164, 60, 16)).addButtonEvent(parent -> {
        extractDimlets();
    }).setTooltips("Extract the dimlets out of", "a realized dimension tab");
    storeButton = new Button(mc, this).setText("Store").setLayoutHint(new PositionalLayout.PositionalHint(13, 182, 60, 16)).addButtonEvent(parent -> {
        storeDimlets();
    }).setTooltips("Store dimlets in a", "empty dimension tab");
    nameField = new TextField(mc, this).addTextEvent((parent, newText) -> {
        storeName(newText);
    }).setLayoutHint(new PositionalLayout.PositionalHint(13, 200, 60, 16));
    validateField = new Label(mc, this).setText("Val");
    validateField.setTooltips("Hover here for errors...");
    validateField.setLayoutHint(new PositionalLayout.PositionalHint(35, 142, 38, 16));
    setNameFromDimensionTab();
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(extractButton).addChild(storeButton).addChild(nameField).addChild(validateField);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) Button(mcjty.lib.gui.widgets.Button) Label(mcjty.lib.gui.widgets.Label) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) TextField(mcjty.lib.gui.widgets.TextField)

Example 3 with Window

use of mcjty.lib.gui.Window in project RFTools by McJty.

the class GuiAnalog method initGui.

@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
    mulEqual = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(106, 78, 30, 16));
    toplevel.addChild(mulEqual);
    mulLess = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(106, 104, 30, 16));
    toplevel.addChild(mulLess);
    mulGreater = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(106, 130, 30, 16));
    toplevel.addChild(mulGreater);
    addEqual = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(153, 78, 30, 16));
    toplevel.addChild(addEqual);
    addLess = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(153, 104, 30, 16));
    toplevel.addChild(addLess);
    addGreater = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(153, 130, 30, 16));
    toplevel.addChild(addGreater);
    mulEqual.setText(fmt.format(tileEntity.getMulEqual()));
    mulLess.setText(fmt.format(tileEntity.getMulLess()));
    mulGreater.setText(fmt.format(tileEntity.getMulGreater()));
    addEqual.setText(String.valueOf(tileEntity.getAddEqual()));
    addLess.setText(String.valueOf(tileEntity.getAddLess()));
    addGreater.setText(String.valueOf(tileEntity.getAddGreater()));
    mulEqual.addTextEvent(this);
    mulLess.addTextEvent(this);
    mulGreater.addTextEvent(this);
    addEqual.addTextEvent(this);
    addLess.addTextEvent(this);
    addGreater.addTextEvent(this);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, ANALOG_WIDTH, ANALOG_HEIGHT));
    window = new Window(this, toplevel);
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Rectangle(java.awt.Rectangle) TextField(mcjty.lib.gui.widgets.TextField)

Example 4 with Window

use of mcjty.lib.gui.Window in project RFTools by McJty.

the class GuiEnvironmentalController method initGui.

@Override
public void initGui() {
    super.initGui();
    int maxEnergyStored = tileEntity.getMaxEnergyStored();
    energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(8, 141, 10, 76)).setShowText(false);
    energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
    Panel areaPanel = initAreaPanel();
    Panel playersPanel = initPlayerPanel();
    Panel controlPanel = initControlPanel();
    toplevel.addChild(areaPanel).addChild(playersPanel).addChild(controlPanel).addChild(energyBar);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
    Keyboard.enableRepeatEvents(true);
    listDirty = 0;
    requestPlayers();
}
Also used : Window(mcjty.lib.gui.Window) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Rectangle(java.awt.Rectangle)

Example 5 with Window

use of mcjty.lib.gui.Window in project RFTools by McJty.

the class GuiCounter method initGui.

@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
    counterField = new TextField(mc, this).setTooltips("Set the counter in pulses").addTextEvent((parent, newText) -> setCounter());
    int delay = tileEntity.getCounter();
    if (delay <= 0) {
        delay = 1;
    }
    counterField.setText(String.valueOf(delay));
    currentField = new TextField(mc, this).setTooltips("Set the current value", "(fires when it reaches counter)").addTextEvent((parent, newText) -> setCurrent());
    int current = tileEntity.getCurrent();
    if (current < 0) {
        current = 0;
    }
    currentField.setText(String.valueOf(current));
    Panel bottomPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Counter:")).addChild(counterField).addChild(new Label(mc, this).setText("Current:")).addChild(currentField);
    toplevel.addChild(bottomPanel);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, COUNTER_WIDTH, COUNTER_HEIGHT));
    window = new Window(this, toplevel);
    requestCurrentCounter();
}
Also used : GenericGuiContainer(mcjty.lib.container.GenericGuiContainer) RFToolsMessages(mcjty.rftools.network.RFToolsMessages) Rectangle(java.awt.Rectangle) TextField(mcjty.lib.gui.widgets.TextField) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) Label(mcjty.lib.gui.widgets.Label) Arguments(mcjty.lib.network.Arguments) EmptyContainer(mcjty.lib.container.EmptyContainer) Window(mcjty.lib.gui.Window) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout) Argument(mcjty.lib.network.Argument) Panel(mcjty.lib.gui.widgets.Panel) CommandHandler(mcjty.rftools.CommandHandler) RFTools(mcjty.rftools.RFTools) Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) Label(mcjty.lib.gui.widgets.Label) Rectangle(java.awt.Rectangle) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) TextField(mcjty.lib.gui.widgets.TextField) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout)

Aggregations

Window (mcjty.lib.gui.Window)74 Panel (mcjty.lib.gui.widgets.Panel)57 PositionalLayout (mcjty.lib.gui.layout.PositionalLayout)48 Label (mcjty.lib.gui.widgets.Label)36 VerticalLayout (mcjty.lib.gui.layout.VerticalLayout)29 HorizontalLayout (mcjty.lib.gui.layout.HorizontalLayout)28 GenericGuiContainer (mcjty.lib.container.GenericGuiContainer)24 Argument (mcjty.lib.network.Argument)24 RFToolsMessages (mcjty.rftools.network.RFToolsMessages)23 java.awt (java.awt)22 Button (mcjty.lib.gui.widgets.Button)22 RFTools (mcjty.rftools.RFTools)22 TextField (mcjty.lib.gui.widgets.TextField)21 Rectangle (java.awt.Rectangle)20 mcjty.lib.gui.widgets (mcjty.lib.gui.widgets)20 HorizontalAlignment (mcjty.lib.gui.layout.HorizontalAlignment)18 ResourceLocation (net.minecraft.util.ResourceLocation)17 StyleConfig (mcjty.lib.base.StyleConfig)15 List (java.util.List)12 EmptyContainer (mcjty.lib.container.EmptyContainer)11