Search in sources :

Example 41 with Window

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

the class GuiRelay method initGui.

@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
    toplevel.addChild(createRedstonePanel());
    for (int i = 0; i < 6; i++) {
        toplevel.addChild(createSidePanel(i));
    }
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, RELAY_WIDTH, RELAY_HEIGHT));
    window = new Window(this, toplevel);
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout)

Example 42 with Window

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

the class GuiMatterTransmitter method initGui.

@Override
public void initGui() {
    super.initGui();
    int maxEnergyStored = tileEntity.getMaxEnergyStored();
    energyBar = new EnergyBar(mc, this).setFilledRectThickness(1).setHorizontal().setDesiredHeight(12).setDesiredWidth(80).setMaxValue(maxEnergyStored).setShowText(false);
    energyBar.setValue(GenericEnergyStorageTileEntity.getCurrentRF());
    TextField textField = new TextField(mc, this).setTooltips("Use this name to", "identify this transmitter", "in the dialer").addTextEvent((parent, newText) -> setTransmitterName(newText));
    textField.setText(tileEntity.getName());
    Panel namePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Name:")).addChild(textField).setDesiredHeight(16);
    privateSetting = new ChoiceLabel(mc, this).addChoices(ACCESS_PUBLIC, ACCESS_PRIVATE).setDesiredHeight(14).setDesiredWidth(60).setChoiceTooltip(ACCESS_PUBLIC, "Everyone can access this transmitter", "and change the dialing destination").setChoiceTooltip(ACCESS_PRIVATE, "Only people in the access list below", "can access this transmitter").addChoiceEvent((parent, newChoice) -> changeAccessMode(newChoice));
    if (tileEntity.isPrivateAccess()) {
        privateSetting.setChoice(ACCESS_PRIVATE);
    } else {
        privateSetting.setChoice(ACCESS_PUBLIC);
    }
    beamToggle = new ToggleButton(mc, this).setText("Hide").setCheckMarker(true).setDesiredHeight(14).setDesiredWidth(49).setTooltips("Hide the teleportation beam").addButtonEvent(parent -> changeBeamState()).setPressed(tileEntity.isBeamHidden());
    Panel privatePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Access:")).addChild(privateSetting).addChild(beamToggle).setDesiredHeight(16);
    allowedPlayers = new WidgetList(mc, this);
    Slider allowedPlayerSlider = new Slider(mc, this).setDesiredWidth(10).setVertical().setScrollable(allowedPlayers);
    Panel allowedPlayersPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(3).setSpacing(1)).addChild(allowedPlayers).addChild(allowedPlayerSlider).setFilledBackground(0xff9e9e9e);
    nameField = new TextField(mc, this);
    addButton = new Button(mc, this).setText("Add").setDesiredHeight(13).setDesiredWidth(34).setTooltips("Add a player to the access list").addButtonEvent(parent -> addPlayer());
    delButton = new Button(mc, this).setText("Del").setDesiredHeight(13).setDesiredWidth(34).setTooltips("Remove the selected player", "from the access list").addButtonEvent(parent -> delPlayer());
    Panel buttonPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(nameField).addChild(addButton).addChild(delButton).setDesiredHeight(16);
    Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout().setHorizontalMargin(3).setVerticalMargin(3).setSpacing(1)).addChild(energyBar).addChild(namePanel).addChild(privatePanel).addChild(allowedPlayersPanel).addChild(buttonPanel);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, MATTER_WIDTH, MATTER_HEIGHT));
    window = new Window(this, toplevel);
    Keyboard.enableRepeatEvents(true);
    listDirty = 0;
    requestPlayers();
    tileEntity.requestRfFromServer(RFTools.MODID);
}
Also used : GenericGuiContainer(mcjty.lib.container.GenericGuiContainer) RFToolsMessages(mcjty.rftools.network.RFToolsMessages) TextField(mcjty.lib.gui.widgets.TextField) java.util(java.util) mcjty.lib.gui.widgets(mcjty.lib.gui.widgets) HorizontalAlignment(mcjty.lib.gui.layout.HorizontalAlignment) PacketGetPlayers(mcjty.rftools.network.PacketGetPlayers) GenericEnergyStorageTileEntity(mcjty.lib.entity.GenericEnergyStorageTileEntity) Keyboard(org.lwjgl.input.Keyboard) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) Label(mcjty.lib.gui.widgets.Label) StyleConfig(mcjty.lib.base.StyleConfig) EmptyContainer(mcjty.lib.container.EmptyContainer) Window(mcjty.lib.gui.Window) java.awt(java.awt) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout) Argument(mcjty.lib.network.Argument) List(java.util.List) Panel(mcjty.lib.gui.widgets.Panel) Button(mcjty.lib.gui.widgets.Button) RFTools(mcjty.rftools.RFTools) Window(mcjty.lib.gui.Window) Label(mcjty.lib.gui.widgets.Label) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout) Panel(mcjty.lib.gui.widgets.Panel) Button(mcjty.lib.gui.widgets.Button) TextField(mcjty.lib.gui.widgets.TextField) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout)

Example 43 with Window

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

the class GuiRemoteStorage 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());
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar);
    for (int i = 0; i < 4; i++) {
        global[i] = new ImageChoiceLabel(mc, this);
        final int finalI = i;
        global[i].addChoiceEvent((parent, newChoice) -> changeGlobal(finalI));
        global[i].addChoice("off" + i, "Cross-dimension access disabled", guiElements, 0, 32);
        global[i].addChoice("on" + i, "Cross-dimension access enabled", guiElements, 16, 32);
        global[i].setLayoutHint(new PositionalLayout.PositionalHint(i < 2 ? (43 - 18) : (120 - 18), (i % 2) == 0 ? 9 : 36, 16, 16));
        global[i].setCurrentChoice(tileEntity.isGlobal(i) ? 1 : 0);
        toplevel.addChild(global[i]);
    }
    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) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) ImageChoiceLabel(mcjty.lib.gui.widgets.ImageChoiceLabel) EnergyBar(mcjty.lib.gui.widgets.EnergyBar)

Example 44 with Window

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

the class GuiElevator method initGui.

@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
    nameField = new TextField(mc, this).setTooltips("Set the name of this floor").addTextEvent((parent, newText) -> updateName());
    nameField.setText(tileEntity.getName());
    Panel bottomPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Name:")).addChild(nameField);
    toplevel.addChild(bottomPanel);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, WIDTH, HEIGHT));
    window = new Window(this, toplevel);
}
Also used : EmptyContainer(mcjty.lib.container.EmptyContainer) GenericGuiContainer(mcjty.lib.container.GenericGuiContainer) Window(mcjty.lib.gui.Window) RFToolsMessages(mcjty.rftools.network.RFToolsMessages) java.awt(java.awt) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout) TextField(mcjty.lib.gui.widgets.TextField) Argument(mcjty.lib.network.Argument) Panel(mcjty.lib.gui.widgets.Panel) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) Label(mcjty.lib.gui.widgets.Label) RFTools(mcjty.rftools.RFTools) Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) Label(mcjty.lib.gui.widgets.Label) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) TextField(mcjty.lib.gui.widgets.TextField) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout)

Example 45 with Window

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

the class GuiEnderMonitor 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("Mode:");
    initGuiMode();
    Panel bottomPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(label).addChild(mode);
    toplevel.addChild(bottomPanel);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, MONITOR_WIDTH, MONITOR_HEIGHT));
    window = new Window(this, toplevel);
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) Label(mcjty.lib.gui.widgets.Label) ChoiceLabel(mcjty.lib.gui.widgets.ChoiceLabel) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) 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