Search in sources :

Example 26 with Window

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

the class GuiSecurityManager method initGui.

@Override
public void initGui() {
    super.initGui();
    players = new WidgetList(mc, this);
    Slider allowedPlayerSlider = new Slider(mc, this).setDesiredWidth(10).setVertical().setScrollable(players);
    Panel allowedPlayersPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(3).setSpacing(1)).addChild(players).addChild(allowedPlayerSlider).setLayoutHint(new PositionalLayout.PositionalHint(72, 5, SECURITYMANAGER_WIDTH - 76, 96));
    nameField = new TextField(mc, this).setDesiredHeight(15);
    addButton = new Button(mc, this).setText("Add").setDesiredHeight(14).setDesiredWidth(34).setTooltips("Add a player to the access list").addButtonEvent(parent -> addPlayer());
    delButton = new Button(mc, this).setText("Del").setDesiredHeight(14).setDesiredWidth(34).setTooltips("Remove the selected player", "from the access list").addButtonEvent(parent -> delPlayer());
    Panel buttonPanel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(3).setSpacing(1)).addChild(nameField).addChild(addButton).addChild(delButton).setDesiredHeight(16).setLayoutHint(new PositionalLayout.PositionalHint(72, 100, SECURITYMANAGER_WIDTH - 76, 14));
    channelNameField = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(8, 27, 60, 14)).addTextEvent((parent, newText) -> updateChannelName());
    blacklistMode = new ImageChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(10, 44, 16, 16)).setTooltips("Black or whitelist mode").addChoiceEvent((parent, newChoice) -> updateSettings());
    blacklistMode.addChoice("White", "Whitelist players", guiElements, 15 * 16, 32);
    blacklistMode.addChoice("Black", "Blacklist players", guiElements, 14 * 16, 32);
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(allowedPlayersPanel).addChild(buttonPanel).addChild(channelNameField).addChild(blacklistMode);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
    Keyboard.enableRepeatEvents(true);
    channelFromServer = null;
}
Also used : GenericGuiContainer(mcjty.lib.container.GenericGuiContainer) RFToolsMessages(mcjty.rftools.network.RFToolsMessages) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) Rectangle(java.awt.Rectangle) mcjty.lib.gui.widgets(mcjty.lib.gui.widgets) HorizontalAlignment(mcjty.lib.gui.layout.HorizontalAlignment) Keyboard(org.lwjgl.input.Keyboard) Arguments(mcjty.lib.network.Arguments) StyleConfig(mcjty.lib.base.StyleConfig) Window(mcjty.lib.gui.Window) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout) Argument(mcjty.lib.network.Argument) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Slot(net.minecraft.inventory.Slot) ResourceLocation(net.minecraft.util.ResourceLocation) CommandHandler(mcjty.rftools.CommandHandler) RFTools(mcjty.rftools.RFTools) Window(mcjty.lib.gui.Window) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Rectangle(java.awt.Rectangle) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout)

Example 27 with Window

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

the class GuiDevelopersDelight method initGui.

@Override
public void initGui() {
    super.initGui();
    int k = (this.width - this.xSize) / 2;
    int l = (this.height - this.ySize) / 2;
    tabbedPanel = new TabbedPanel(mc, this);
    Panel tab1 = createBlockClassesPage();
    Panel tab2 = createTeClassesPage();
    Panel tab3 = createNbtDataPage();
    tabbedPanel.addPage("Block", tab1).addPage("TE", tab2).addPage("NBT", tab3);
    ToggleButton tab1Button = createToggleButton("Block");
    ToggleButton tab2Button = createToggleButton("TE");
    ToggleButton tab3Button = createToggleButton("NBT");
    clientServerMode = new ChoiceLabel(mc, this).setDesiredWidth(60).addChoices("Server", "Client").setChoice("Server").addChoiceEvent((parent, newChoice) -> requestNewLists()).setDesiredHeight(16).setTooltips("Switch between client", "and server information");
    metaData = new TextField(mc, this).setDesiredHeight(14).setTooltips("Metadata for this block");
    Panel buttonPanel = new Panel(mc, this).setLayout(new VerticalLayout()).setDesiredWidth(62).addChild(tab1Button).addChild(tab2Button).addChild(tab3Button).addChild(new Label(mc, this).setDynamic(true)).addChild(clientServerMode).addChild(metaData).addChild(new Label(mc, this).setDynamic(true));
    Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new HorizontalLayout()).addChild(buttonPanel).addChild(tabbedPanel);
    toplevel.setBounds(new Rectangle(k, l, xSize, ySize));
    window = new Window(this, toplevel);
    requestNewLists();
}
Also used : RFToolsMessages(mcjty.rftools.network.RFToolsMessages) TextField(mcjty.lib.gui.widgets.TextField) mcjty.lib.gui.widgets(mcjty.lib.gui.widgets) HorizontalAlignment(mcjty.lib.gui.layout.HorizontalAlignment) BlockPos(net.minecraft.util.math.BlockPos) IOException(java.io.IOException) HashMap(java.util.HashMap) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) Label(mcjty.lib.gui.widgets.Label) Mouse(org.lwjgl.input.Mouse) ArrayList(java.util.ArrayList) StyleConfig(mcjty.lib.base.StyleConfig) Window(mcjty.lib.gui.Window) java.awt(java.awt) IBlockState(net.minecraft.block.state.IBlockState) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout) GuiScreen(net.minecraft.client.gui.GuiScreen) List(java.util.List) Panel(mcjty.lib.gui.widgets.Panel) Block(net.minecraft.block.Block) Minecraft(net.minecraft.client.Minecraft) Map(java.util.Map) Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) Label(mcjty.lib.gui.widgets.Label) TextField(mcjty.lib.gui.widgets.TextField) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) HorizontalLayout(mcjty.lib.gui.layout.HorizontalLayout)

Example 28 with Window

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

the class GuiAdvancedPorter method initGui.

@Override
public void initGui() {
    super.initGui();
    int k = (this.width - xSize) / 2;
    int l = (this.height - ySize) / 2;
    Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout().setSpacing(0));
    for (int i = 0; i < AdvancedChargedPorterItem.MAXTARGETS; i++) {
        destinations[i] = new TextField(mc, this);
        panels[i] = createPanel(destinations[i], i);
        toplevel.addChild(panels[i]);
    }
    toplevel.setBounds(new Rectangle(k, l, xSize, ySize));
    window = new Window(this, toplevel);
    updateInfoFromServer();
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) Rectangle(java.awt.Rectangle) VerticalLayout(mcjty.lib.gui.layout.VerticalLayout) TextField(mcjty.lib.gui.widgets.TextField)

Example 29 with Window

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

the class GuiModifier method initGui.

@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setLayout(new PositionalLayout()).setBackground(iconLocation);
    mode = new ChoiceLabel(mc, this).addChoices(ModifierFilterType.FILTER_SLOT.getCode(), ModifierFilterType.FILTER_ORE.getCode(), ModifierFilterType.FILTER_LIQUID.getCode(), ModifierFilterType.FILTER_TILEENTITY.getCode());
    mode.setLayoutHint(new PositionalLayout.PositionalHint(30, 9, 45, 14));
    toplevel.addChild(mode);
    op = new ChoiceLabel(mc, this).addChoices(ModifierFilterOperation.OPERATION_SLOT.getCode(), ModifierFilterOperation.OPERATION_VOID.getCode());
    op.setLayoutHint(new PositionalLayout.PositionalHint(110, 9, 40, 14));
    toplevel.addChild(op);
    add = new Button(mc, this).setText("Add");
    add.setLayoutHint(new PositionalLayout.PositionalHint(10, 30, 40, 13));
    add.addButtonEvent(parent -> addOp());
    toplevel.addChild(add);
    del = new Button(mc, this).setText("Del");
    del.setLayoutHint(new PositionalLayout.PositionalHint(52, 30, 40, 13));
    del.addButtonEvent(parent -> delOp());
    toplevel.addChild(del);
    up = new Button(mc, this).setText("Up");
    up.setLayoutHint(new PositionalLayout.PositionalHint(110, 30, 30, 13));
    up.addButtonEvent(parent -> upOp());
    toplevel.addChild(up);
    down = new Button(mc, this).setText("Down");
    down.setLayoutHint(new PositionalLayout.PositionalHint(142, 30, 30, 13));
    down.addButtonEvent(parent -> downOp());
    toplevel.addChild(down);
    list = new WidgetList(mc, this);
    list.setLayoutHint(new PositionalLayout.PositionalHint(9, 45, 153, 95));
    toplevel.addChild(list);
    Slider slider = new Slider(mc, this).setVertical().setScrollable(list);
    slider.setLayoutHint(new PositionalLayout.PositionalHint(162, 45, 10, 95));
    toplevel.addChild(slider);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
}
Also used : Window(mcjty.lib.gui.Window) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout) Rectangle(java.awt.Rectangle)

Example 30 with Window

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

the class GuiBuilder 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, 6, 8, 59)).setShowText(false);
    energyBar.setValue(getCurrentRF());
    initRedstoneMode();
    configButton = new Button(mc, this).setText("?");
    configButton.setLayoutHint(new PositionalLayout.PositionalHint(83, 12, 13, 12));
    configButton.addButtonEvent(parent -> openCardGui());
    configButton.setTooltips("Click to open the card gui");
    currentLevel = new Button(mc, this);
    currentLevel.setText("Y:").setTooltips("Current level the builder is at", TextFormatting.YELLOW + "Press to restart!").setLayoutHint(new PositionalLayout.PositionalHint(81, 31, 45, 13)).addButtonEvent(parent -> restart());
    Panel positionPanel = setupPositionPanel();
    Panel modePanel = setupModePanel();
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout()).addChild(energyBar).addChild(modePanel).addChild(positionPanel).addChild(configButton).addChild(currentLevel).addChild(redstoneMode);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
    tileEntity.requestRfFromServer(RFTools.MODID);
    tileEntity.requestCurrentLevel();
}
Also used : Window(mcjty.lib.gui.Window) Panel(mcjty.lib.gui.widgets.Panel) Button(mcjty.lib.gui.widgets.Button) PositionalLayout(mcjty.lib.gui.layout.PositionalLayout)

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