mcjty.lib.gui.widgets.Panel.addChild() - java examples

Here are the examples of the java api mcjty.lib.gui.widgets.Panel.addChild() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

55 Examples 7

18 View Complete Implementation : GuiCraftingStation.java
Copyright MIT License
Author : McJtyMods
private void initButtons(Panel toplevel) {
    searchField = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(5, 5, WIDTH - 46 - 10, 16));
    cancelButton = new Button(mc, this).setChannel("cancel").setLayoutHint(new PositionalLayout.PositionalHint(WIDTH - 46 - 5, 5, 46, 16)).setText("Cancel").setTooltips(TextFormatting.YELLOW + "Cancel request", "Cancel the currently selected", "crafting request");
    toplevel.addChild(cancelButton).addChild(searchField);
}

18 View Complete Implementation : GuiProcessor.java
Copyright MIT License
Author : McJtyMods
private void setupLogWindow(Panel toplevel) {
    log = new WidgetList(mc, this).setName("log").setFilledBackground(0xff000000).setFilledRectThickness(1).setLayoutHint(new PositionalLayout.PositionalHint(9, 35, 173, 98)).setRowheight(14).setInvisibleSelection(true).setDrawHorizontalLines(false);
    Slider slider = new Slider(mc, this).setVertical().setScrollableName("log").setLayoutHint(new PositionalLayout.PositionalHint(183, 35, 9, 98));
    command = new TextField(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(9, 35 + 99, 183, 15)).addTextEnterEvent((e, text) -> executeCommand(text)).addSpecialKeyEvent(new TextSpecialKeyEvent() {

        @Override
        public void arrowUp(Widget widget) {
            dumpHistory();
            if (commandHistoryIndex == -1) {
                commandHistoryIndex = commandHistory.size() - 1;
            } else {
                commandHistoryIndex--;
                if (commandHistoryIndex < 0) {
                    commandHistoryIndex = 0;
                }
            }
            if (commandHistoryIndex >= 0 && commandHistoryIndex < commandHistory.size()) {
                command.setText(commandHistory.get(commandHistoryIndex));
            }
            dumpHistory();
        }

        @Override
        public void arrowDown(Widget widget) {
            dumpHistory();
            if (commandHistoryIndex != -1) {
                commandHistoryIndex++;
                if (commandHistoryIndex >= commandHistory.size()) {
                    commandHistoryIndex = -1;
                    command.setText("");
                } else {
                    command.setText(commandHistory.get(commandHistoryIndex));
                }
            }
            dumpHistory();
        }

        @Override
        public void tab(Widget widget) {
        }
    });
    toplevel.addChild(log).addChild(slider).addChild(command);
}

18 View Complete Implementation : GuiCraftingStation.java
Copyright MIT License
Author : McJtyMods
private void initProgressList(Panel toplevel) {
    requestList = new WidgetList(mc, this).setName("requests").setLayoutHint(new PositionalLayout.PositionalHint(136, 23, 80, 128));
    Slider slider = new Slider(mc, this).setScrollableName("requests").setLayoutHint(new PositionalLayout.PositionalHint(136 + 80 + 1, 23, 9, 128));
    toplevel.addChild(requestList).addChild(slider);
}

18 View Complete Implementation : GuiProcessor.java
Copyright MIT License
Author : McJtyMods
private void updateFluidList() {
    fluidList.removeChildren();
    for (int i = 0; i < fluidListMapping.length; i++) {
        fluidListMapping[i] = -1;
    }
    int setupMode = getSetupMode();
    int fluidAlloc = 0;
    if (setupMode != -1) {
        CardInfo cardInfo = tileEnreplacedy.getCardInfo(setupMode);
        fluidAlloc = cardInfo.getFluidAllocation();
    }
    fluidList.setPropagateEventsToChildren(setupMode == -1);
    int index = 0;
    for (int i = 0; i < fromServer_fluids.size(); i++) {
        PacketGetFluids.FluidEntry entry = fromServer_fluids.get(i);
        if (entry.isAllocated()) {
            fluidListMapping[fluidList.getChildCount()] = i;
            EnumFacing side = EnumFacing.values()[i / TANKS];
            String l = side.getName().substring(0, 1).toUpperCase() + (i % TANKS);
            Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout()).setDesiredWidth(40);
            AbstractWidget<?> label;
            if (setupMode != -1) {
                boolean allocated = ((fluidAlloc >> i) & 1) != 0;
                int fill = allocated ? 0x7700ff00 : (tileEnreplacedy.isFluidAllocated(-1, i) ? 0x77660000 : 0x77444444);
                panel.setFilledBackground(fill);
                if (allocated) {
                    label = new Label(mc, this).setColor(0xffffffff).setText(String.valueOf(index)).setDesiredWidth(26).setUserObject("allowed");
                    index++;
                } else {
                    label = new Label(mc, this).setText("/").setDesiredWidth(26).setUserObject("allowed");
                }
            } else {
                label = new Label(mc, this).setText(l).setDesiredWidth(26).setUserObject("allowed");
            }
            label.setUserObject("allowed");
            panel.addChild(label);
            FluidStack fluidStack = entry.getFluidStack();
            if (fluidStack != null) {
                BlockRender fluid = new BlockRender(mc, this).setRenderItem(fluidStack);
                fluid.setTooltips(TextFormatting.GREEN + "Fluid: " + TextFormatting.WHITE + fluidStack.getLocalizedName(), TextFormatting.GREEN + "Amount: " + TextFormatting.WHITE + fluidStack.amount + "mb");
                fluid.setUserObject("allowed");
                panel.addChild(fluid);
            }
            panel.setUserObject("allowed");
            fluidList.addChild(panel);
        }
    }
}

18 View Complete Implementation : GuiCraftingStation.java
Copyright MIT License
Author : McJtyMods
private void initRecipeList(Panel toplevel) {
    recipeList = new WidgetList(mc, this).setName("recipes").setLayoutHint(new PositionalLayout.PositionalHint(5, 23, 120, 128)).setPropagateEventsToChildren(true).setInvisibleSelection(true);
    Slider slider = new Slider(mc, this).setScrollableName("recipes").setLayoutHint(new PositionalLayout.PositionalHint(126, 23, 9, 128));
    toplevel.addChild(recipeList).addChild(slider);
}

18 View Complete Implementation : GuiProcessor.java
Copyright MIT License
Author : McJtyMods
private void updateVariableList() {
    variableList.removeChildren();
    int setupMode = getSetupMode();
    int varAlloc = 0;
    if (setupMode != -1) {
        CardInfo cardInfo = tileEnreplacedy.getCardInfo(setupMode);
        varAlloc = cardInfo.getVarAllocation();
    }
    variableList.setPropagateEventsToChildren(setupMode == -1);
    int index = 0;
    for (int i = 0; i < tileEnreplacedy.getMaxvars(); i++) {
        Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout()).setDesiredWidth(40);
        if (setupMode != -1) {
            boolean allocated = ((varAlloc >> i) & 1) != 0;
            int fill = allocated ? 0x7700ff00 : (tileEnreplacedy.isVarAllocated(-1, i) ? 0x77660000 : 0x77444444);
            panel.setFilledBackground(fill);
            if (allocated) {
                panel.addChild(new Label(mc, this).setColor(0xffffffff).setText(String.valueOf(index)).setDesiredWidth(26).setUserObject("allowed"));
                index++;
            } else {
                panel.addChild(new Label(mc, this).setText("/").setDesiredWidth(26).setUserObject("allowed"));
            }
        } else {
            panel.addChild(new Label(mc, this).setText(String.valueOf(i)).setDesiredWidth(26).setUserObject("allowed"));
        }
        int finalI = i;
        panel.addChild(new Button(mc, this).addButtonEvent(w -> openValueEditor(finalI)).setText("...").setUserObject("allowed"));
        panel.setUserObject("allowed");
        variableList.addChild(panel);
    }
}

17 View Complete Implementation : GuiCraftingCard.java
Copyright MIT License
Author : McJtyMods
private void createDummySlot(Panel toplevel, int idx, PositionalLayout.PositionalHint hint, BlockRenderEvent selectionEvent) {
    slots[idx] = new BlockRender(mc, this) {

        @Override
        public List<String> getTooltips() {
            Object s = slots[idx].getRenderItem();
            if (s instanceof ItemStack) {
                ItemStack stack = (ItemStack) s;
                if (!stack.isEmpty()) {
                    ITooltipFlag flag = this.mc.gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL;
                    List<String> list = stack.getTooltip(this.mc.player, flag);
                    for (int i = 0; i < list.size(); ++i) {
                        if (i == 0) {
                            list.set(i, stack.getRarity().rarityColor + list.get(i));
                        } else {
                            list.set(i, TextFormatting.GRAY + list.get(i));
                        }
                    }
                    return list;
                } else {
                    return Collections.emptyList();
                }
            } else {
                return Collections.emptyList();
            }
        }
    }.setHilightOnHover(true).setLayoutHint(hint);
    slots[idx].addSelectionEvent(selectionEvent);
    toplevel.addChild(slots[idx]);
}

17 View Complete Implementation : GuiDimletWorkbench.java
Copyright MIT License
Author : McJtyMods
private void addItemToList(DimletKey key) {
    Panel panel = new Panel(mc, this).setLayout(new PositionalLayout()).setDesiredWidth(116).setDesiredHeight(16);
    panel.setUserObject(key);
    itemList.addChild(panel);
    BlockRender blockRender = new BlockRender(mc, this).setRenderItem(KnownDimletConfiguration.getDimletStack(key)).setLayoutHint(new PositionalLayout.PositionalHint(1, 0, 16, 16)).setUserObject(key);
    panel.addChild(blockRender);
    String displayName = KnownDimletConfiguration.getDisplayName(key);
    AbstractWidget label = new Label(mc, this).setText(displayName).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(20, 0, 95, 16)).setUserObject(key);
    panel.addChild(label);
}

17 View Complete Implementation : GuiCraftingStation.java
Copyright MIT License
Author : McJtyMods
private void updateRequestList() {
    requestList.removeChildren();
    for (CraftingRequest request : fromServer_requests) {
        final ItemStack stack = request.getStack();
        Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout()).setDesiredWidth(16);
        requestList.addChild(panel);
        BlockRender blockRender = new BlockRender(mc, this).setRenderItem(stack).setOffsetX(-1).setOffsetY(-1);
        panel.addChild(blockRender);
        boolean failed = request.getFailed() != -1;
        boolean ok = request.getOk() != -1;
        panel.addChild(new Label(mc, this).setColor(failed ? 0xffff3030 : (ok ? 0xff30ff30 : StyleConfig.colorTextNormal)).setText(failed ? "Failed!" : (ok ? "Ok" : "Wait (" + request.getTodo() + ")")));
    }
}

17 View Complete Implementation : GuiDialingDevice.java
Copyright MIT License
Author : McJtyMods
private void populateReceivers() {
    List<TeleportDestinationClientInfo> newReceivers = fromServer_receivers;
    if (newReceivers == null) {
        return;
    }
    boolean newReceiversFiltered = favoriteButton.getCurrentChoiceIndex() == 1;
    if (newReceivers.equals(receivers) && newReceiversFiltered == receiversFiltered) {
        return;
    }
    receiversFiltered = newReceiversFiltered;
    if (receiversFiltered) {
        receivers = new ArrayList<>();
        // We only show favorited receivers. Remove the rest.
        for (TeleportDestinationClientInfo receiver : newReceivers) {
            if (receiver.isFavorite()) {
                receivers.add(receiver);
            }
        }
    } else {
        // Show all receivers.
        receivers = new ArrayList<>(newReceivers);
    }
    receiverList.removeChildren();
    for (TeleportDestinationClientInfo destination : receivers) {
        BlockPos coordinate = destination.getCoordinate();
        String dimName = destination.getDimensionName();
        if (dimName == null || dimName.trim().isEmpty()) {
            dimName = "Id " + destination.getDimension();
        }
        boolean favorite = destination.isFavorite();
        Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout().setSpacing(1).setHorizontalMargin(3));
        panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(destination.getName()).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setDesiredWidth(96).setTooltips("The name of the", "destination receiver:", destination.getName() + " (" + BlockPosTools.toString(coordinate) + ")"));
        panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(dimName).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setDynamic(true).setTooltips("The name of the", "destination dimension:", dimName).setDesiredWidth(110));
        ImageChoiceLabel choiceLabel = new ImageChoiceLabel(mc, this).addChoiceEvent((parent, newChoice) -> changeFavorite()).setDesiredWidth(10);
        choiceLabel.addChoice("No", "Not favorited", guielements, 131, 19);
        choiceLabel.addChoice("Yes", "Favorited", guielements, 115, 19);
        choiceLabel.setCurrentChoice(favorite ? 1 : 0);
        panel.addChild(choiceLabel);
        receiverList.addChild(panel);
    }
}

16 View Complete Implementation : GuiCraftingStation.java
Copyright MIT License
Author : McJtyMods
private void updateRecipeList() {
    String filterText = searchField.getText().toLowerCase().trim();
    fromServer_craftables.sort((r1, r2) -> {
        return r1.getDisplayName().compareTo(r2.getDisplayName());
    });
    recipeList.removeChildren();
    Panel panel = null;
    int index = 0;
    for (ItemStack stack : fromServer_craftables) {
        String displayName = stack.getDisplayName();
        if ((!filterText.isEmpty()) && !displayName.toLowerCase().contains(filterText)) {
            continue;
        }
        if (panel == null || panel.getChildCount() >= 6) {
            panel = new Panel(mc, this).setLayout(new HorizontalLayout().setSpacing(3).setHorizontalMargin(1)).setDesiredHeight(16);
            recipeList.addChild(panel);
        }
        BlockRender blockRender = new BlockRender(mc, this).setRenderItem(stack).setHilightOnHover(true).setOffsetX(-1).setOffsetY(-1).setUserObject(index);
        index++;
        blockRender.addSelectionEvent(new BlockRenderEvent() {

            @Override
            public void select(Widget widget) {
                BlockRender br = (BlockRender) widget;
                Object item = br.getRenderItem();
                if (item != null) {
                    boolean shift = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
                    Object index = br.getUserObject();
                    if (shift) {
                        askAmountToCraft(stack);
                    } else {
                        requesreplacedem(stack, 1);
                    }
                }
            }

            @Override
            public void doubleClick(Widget widget) {
            }
        });
        panel.addChild(blockRender);
    }
}

16 View Complete Implementation : ShapeGuiTools.java
Copyright MIT License
Author : McJtyMods
public static ToggleButton createScanButton(Gui gui, Panel toplevel, int x, int y) {
    ToggleButton showAxis = new ToggleButton(Minecraft.getMinecraft(), gui).setCheckMarker(true).setTooltips("Show a visual scanline", "wherever the preview", "is updated").setText("S").setLayoutHint(new PositionalLayout.PositionalHint(x, y, 24, 16));
    showAxis.setPressed(true);
    toplevel.addChild(showAxis);
    return showAxis;
}

16 View Complete Implementation : ShapeGuiTools.java
Copyright MIT License
Author : McJtyMods
public static ToggleButton createBoxButton(Gui gui, Panel toplevel, int x, int y) {
    ToggleButton showAxis = new ToggleButton(Minecraft.getMinecraft(), gui).setCheckMarker(true).setTooltips("Enable preview of the", "outer bounds").setText("B").setLayoutHint(new PositionalLayout.PositionalHint(x, y, 24, 16));
    showAxis.setPressed(true);
    toplevel.addChild(showAxis);
    return showAxis;
}

16 View Complete Implementation : ShapeGuiTools.java
Copyright MIT License
Author : McJtyMods
public static ToggleButton createAxisButton(Gui gui, Panel toplevel, int x, int y) {
    ToggleButton showAxis = new ToggleButton(Minecraft.getMinecraft(), gui).setCheckMarker(true).setTooltips("Enable axis rendering", "in the preview").setText("A").setLayoutHint(new PositionalLayout.PositionalHint(x, y, 24, 16));
    showAxis.setPressed(true);
    toplevel.addChild(showAxis);
    return showAxis;
}

16 View Complete Implementation : GuiModifier.java
Copyright MIT License
Author : McJtyMods
@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_TILEENreplacedY.getCode());
    mode.setLayoutHint(30, 9, 45, 14);
    toplevel.addChild(mode);
    op = new ChoiceLabel(mc, this).addChoices(ModifierFilterOperation.OPERATION_SLOT.getCode(), ModifierFilterOperation.OPERATION_VOID.getCode());
    op.setLayoutHint(110, 9, 40, 14);
    toplevel.addChild(op);
    add = new Button(mc, this).setChannel("add").setText("Add");
    add.setLayoutHint(10, 30, 40, 13);
    toplevel.addChild(add);
    del = new Button(mc, this).setChannel("del").setText("Del");
    del.setLayoutHint(52, 30, 40, 13);
    toplevel.addChild(del);
    up = new Button(mc, this).setChannel("up").setText("Up");
    up.setLayoutHint(110, 30, 30, 13);
    toplevel.addChild(up);
    down = new Button(mc, this).setChannel("down").setText("Down");
    down.setLayoutHint(142, 30, 30, 13);
    toplevel.addChild(down);
    list = new WidgetList(mc, this).setName("list");
    list.setLayoutHint(9, 45, 153, 95);
    toplevel.addChild(list);
    Slider slider = new Slider(mc, this).setVertical().setScrollableName("list");
    slider.setLayoutHint(162, 45, 10, 95);
    toplevel.addChild(slider);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
    window.event("add", (source, params) -> addOp());
    window.event("del", (source, params) -> delOp());
    window.event("up", (source, params) -> upOp());
    window.event("down", (source, params) -> downOp());
}

16 View Complete Implementation : GuiAdvancedPorter.java
Copyright MIT License
Author : McJtyMods
@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();
}

15 View Complete Implementation : GuiComposer.java
Copyright MIT License
Author : McJtyMods
@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
    getShapeRenderer().initView(getPreviewLeft(), guiTop + 100);
    ShapeModifier[] modifiers = tileEnreplacedy.getModifiers();
    operationLabels[0] = null;
    for (int i = 0; i < ComposerTileEnreplacedy.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 < ComposerTileEnreplacedy.SLOT_COUNT; i++) {
        configButton[i] = new Button(mc, this).setText("?").setChannel("config" + i);
        configButton[i].setLayoutHint(new PositionalLayout.PositionalHint(3, 7 + i * 18 + 2, 13, 12));
        configButton[i].setTooltips("Click to open the card gui");
        toplevel.addChild(configButton[i]);
    }
    outConfigButton = new Button(mc, this).setText("?").setChannel("outconfig");
    outConfigButton.setLayoutHint(new PositionalLayout.PositionalHint(3, 200 + 2, 13, 12));
    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(5, 175, 15, 15));
    sidePanel.addChild(new Label(mc, this).setText("W").setColor(0xffff0000).setTooltips(tt).setLayoutHint(40, 175, 15, 15));
    sidePanel.addChild(new Label(mc, this).setText("U").setColor(0xff00bb00).setTooltips(tt).setLayoutHint(5, 190, 15, 15));
    sidePanel.addChild(new Label(mc, this).setText("D").setColor(0xff00bb00).setTooltips(tt).setLayoutHint(40, 190, 15, 15));
    sidePanel.addChild(new Label(mc, this).setText("N").setColor(0xff0000ff).setTooltips(tt).setLayoutHint(5, 205, 15, 15));
    sidePanel.addChild(new Label(mc, this).setText("S").setColor(0xff0000ff).setTooltips(tt).setLayoutHint(40, 205, 15, 15));
    for (int i = 0; i < ComposerTileEnreplacedy.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);
    for (int i = 0; i < ComposerTileEnreplacedy.SLOT_COUNT; i++) {
        int finalI1 = i;
        window.event("config" + i, (source, params) -> openCardGui(finalI1));
    }
    window.event("outconfig", (source, params) -> openCardGui(-1));
}

15 View Complete Implementation : GuiDialingDevice.java
Copyright MIT License
Author : McJtyMods
private void populateTransmitters() {
    List<TransmitterInfo> newTransmitters = fromServer_transmitters;
    if (newTransmitters == null) {
        return;
    }
    if (newTransmitters.equals(transmitters)) {
        return;
    }
    transmitters = new ArrayList<>(newTransmitters);
    transmitterList.removeChildren();
    for (TransmitterInfo transmitterInfo : transmitters) {
        BlockPos coordinate = transmitterInfo.getCoordinate();
        TeleportDestination destination = transmitterInfo.getTeleportDestination();
        Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(3));
        panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(transmitterInfo.getName()).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setDesiredWidth(102));
        panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setDynamic(true).setText(BlockPosTools.toString(coordinate)).setDesiredWidth(90));
        panel.addChild(new ImageLabel(mc, this).setImage(guielements, destination.isValid() ? 80 : 96, 0).setDesiredWidth(16));
        transmitterList.addChild(panel);
    }
    if (transmitterList.getChildCount() == 1) {
        transmitterList.setSelected(0);
    }
}

15 View Complete Implementation : GuiModifier.java
Copyright MIT License
Author : McJtyMods
private void refreshList() {
    list.removeChildren();
    List<ModifierEntry> modifiers = getModifiers();
    for (ModifierEntry modifier : modifiers) {
        ItemStack stackIn = modifier.getIn();
        ItemStack stackOut = modifier.getOut();
        ModifierFilterType type = modifier.getType();
        ModifierFilterOperation op = modifier.getOp();
        Panel panel = new Panel(mc, this).setLayout(new PositionalLayout()).setDesiredHeight(18).setDesiredWidth(150);
        panel.addChild(new BlockRender(mc, this).setLayoutHint(1, 0, 18, 18).setRenderItem(stackIn));
        panel.addChild(new Label(mc, this).setText(type.getCode() + " -> " + op.getCode()).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setLayoutHint(22, 0, 100, 18));
        panel.addChild(new BlockRender(mc, this).setLayoutHint(130, 0, 18, 18).setRenderItem(stackOut));
        list.addChild(panel);
    }
}

15 View Complete Implementation : GuiMultiTank.java
Copyright MIT License
Author : McJtyMods
@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setLayout(new PositionalLayout()).setBackground(iconLocation);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    for (int i = 0; i < TANKS; i++) {
        liquids[i] = new BlockRender(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(10, 9 + i * 18, 16, 16));
        toplevel.addChild(liquids[i]);
        labels[i] = new Label(mc, this);
        labels[i].setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setVerticalAlignment(VerticalAlignment.ALIGN_CENTER).setLayoutHint(new PositionalLayout.PositionalHint(32, 9 + i * 18, WIDTH - 32 - 6, 16));
        toplevel.addChild(labels[i]);
    }
    window = new Window(this, toplevel);
}

15 View Complete Implementation : GuiNode.java
Copyright MIT License
Author : McJtyMods
@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
    channelField = new TextField(mc, this).setTooltips("Set the name of the network", "channel to connect too").addTextEvent((parent, newText) -> updateNode());
    channelField.setText(tileEnreplacedy.getChannelName());
    nodeNameField = new TextField(mc, this).setTooltips("Set the name of this node").addTextEvent((parent, newText) -> updateNode());
    nodeNameField.setText(tileEnreplacedy.getNodeName());
    Panel bottomPanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Channel:")).addChild(channelField).addChild(new Label(mc, this).setText("Node:")).addChild(nodeNameField);
    toplevel.addChild(bottomPanel);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, WIDTH, HEIGHT));
    window = new Window(this, toplevel);
}

15 View Complete Implementation : BooleanEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
    label = new ChoiceLabel(mc, gui).addChoices("*", "true", "false").addChoiceEvent((parent, newChoice) -> callback.valueChanged(readValue())).setDesiredWidth(60);
    constantPanel.addChild(label);
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_BOOLEAN);
}

15 View Complete Implementation : FloatEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
    field = new TextField(mc, gui).addTextEvent((parent, newText) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow());
    constantPanel.addChild(field);
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_FLOAT);
}

15 View Complete Implementation : IntegerEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
    field = new TextField(mc, gui).addTextEvent((parent, newText) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow());
    constantPanel.addChild(field);
    hexMode = new ToggleButton(mc, gui).addButtonEvent(widget -> updateHex()).setCheckMarker(true).setText("Hex");
    constantPanel.addChild(hexMode);
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_INTEGER);
}

15 View Complete Implementation : InventoryEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new VerticalLayout());
    nameLabel = new TextField(mc, gui).addTextEvent((o, text) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow()).setDesiredWidth(50).setDesiredHeight(14);
    constantPanel.addChild(createLabeledPanel(mc, gui, "Node name:", nameLabel, "Optional name of a node in the network"));
    sideLabel = new ChoiceLabel(mc, gui).addChoices("*", "Down", "Up", "North", "South", "West", "East").addChoiceEvent((parent, newChoice) -> callback.valueChanged(readValue())).setDesiredWidth(60);
    constantPanel.addChild(createLabeledPanel(mc, gui, "Side:", sideLabel, "Side relative to processor or node", "for the desired inventory"));
    intSideLabel = new ChoiceLabel(mc, gui).addChoices("*", "Down", "Up", "North", "South", "West", "East").addChoiceEvent((parent, newChoice) -> callback.valueChanged(readValue())).setDesiredWidth(60);
    constantPanel.addChild(createLabeledPanel(mc, gui, "Access:", intSideLabel, "Optional side from which we want to", "access the given inventory"));
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_INVENTORY);
}

15 View Complete Implementation : SideEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new VerticalLayout());
    nameLabel = new TextField(mc, gui).addTextEvent((o, text) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow()).setDesiredWidth(50).setDesiredHeight(14);
    constantPanel.addChild(createLabeledPanel(mc, gui, "Node name:", nameLabel, "Optional name of a node in the network"));
    label = new ChoiceLabel(mc, gui).addChoices("*", "Down", "Up", "North", "South", "West", "East").addChoiceEvent((parent, newChoice) -> callback.valueChanged(readValue())).setDesiredWidth(60);
    constantPanel.addChild(createLabeledPanel(mc, gui, "Side:", label, "Side relative to processor or node", "for the desired block"));
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_SIDE);
}

15 View Complete Implementation : GuiConnector.java
Copyright MIT License
Author : McJtyMods
@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setFilledRectThickness(2).setLayout(new VerticalLayout());
    TextField nameField = new TextField(mc, this).setName("name").setTooltips("Set the name of this connector");
    Panel namePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Name:")).addChild(nameField);
    toplevel.addChild(namePanel);
    Panel togglePanel = new Panel(mc, this).setLayout(new HorizontalLayout()).addChild(new Label(mc, this).setText("Directions:"));
    for (EnumFacing facing : EnumFacing.VALUES) {
        toggleButtons[facing.ordinal()] = new ToggleButton(mc, this).setText(facing.getName().substring(0, 1).toUpperCase()).addButtonEvent(parent -> {
            sendServerCommand(XNetMessages.INSTANCE, ConnectorTileEnreplacedy.CMD_ENABLE, TypedMap.builder().put(PARAM_FACING, facing.ordinal()).put(PARAM_ENABLED, toggleButtons[facing.ordinal()].isPressed()).build());
        });
        toggleButtons[facing.ordinal()].setPressed(tileEnreplacedy.isEnabled(facing));
        togglePanel.addChild(toggleButtons[facing.ordinal()]);
    }
    toplevel.addChild(togglePanel);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, WIDTH, HEIGHT));
    window = new Window(this, toplevel);
    window.bind(XNetMessages.INSTANCE, "name", tileEnreplacedy, VALUE_NAME.getName());
}

14 View Complete Implementation : LongEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
    field = new TextField(mc, gui).addTextEvent((parent, newText) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow());
    constantPanel.addChild(field);
    hexMode = new ToggleButton(mc, gui).addButtonEvent(widget -> updateHex()).setCheckMarker(true).setText("Hex");
    constantPanel.addChild(hexMode);
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_LONG);
}

14 View Complete Implementation : NumberEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new VerticalLayout());
    typeLabel = new ChoiceLabel(mc, gui).addChoices("Integer", "Long", "Float", "Double").addChoiceEvent((parent, newChoice) -> callback.valueChanged(readValue())).setDesiredWidth(60);
    constantPanel.addChild(createLabeledPanel(mc, gui, "Type:", typeLabel, "Type of the number"));
    field = new TextField(mc, gui).addTextEvent((parent, newText) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow());
    constantPanel.addChild(field);
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_NUMBER);
}

14 View Complete Implementation : StringEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
    field = new TextField(mc, gui).addTextEvent((parent, newText) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow());
    constantPanel.addChild(field);
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_STRING);
}

14 View Complete Implementation : TupleEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
    fieldX = new TextField(mc, gui).addTextEvent((parent, newText) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow());
    fieldY = new TextField(mc, gui).addTextEvent((parent, newText) -> callback.valueChanged(readValue())).addTextEnterEvent((parent, newText) -> closeWindow());
    constantPanel.addChild(fieldX).addChild(fieldY);
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_TUPLE);
}

14 View Complete Implementation : VectorEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
    constantPanel.addChild(new Label(mc, gui).setText("No constant editor"));
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_VECTOR);
}

14 View Complete Implementation : GuiShield.java
Copyright MIT License
Author : McJtyMods
private void populateFilters() {
    List<ShieldFilter> newFilters = new ArrayList<>(fromServer_filters);
    if (newFilters.equals(filters)) {
        return;
    }
    filters = new ArrayList<>(newFilters);
    filterList.removeChildren();
    for (ShieldFilter filter : filters) {
        String n;
        if ("player".equals(filter.getFilterName())) {
            PlayerFilter playerFilter = (PlayerFilter) filter;
            if (playerFilter.getName() == null || playerFilter.getName().isEmpty()) {
                n = "players";
            } else {
                n = "player " + playerFilter.getName();
            }
        } else {
            n = filter.getFilterName();
        }
        Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout());
        panel.addChild(new Label(mc, this).setText(n).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setDesiredWidth(85));
        String actionName;
        boolean solid = (filter.getAction() & ShieldFilter.ACTION_SOLID) != 0;
        boolean damage = (filter.getAction() & ShieldFilter.ACTION_DAMAGE) != 0;
        if (solid && damage) {
            actionName = ACTION_SOLIDDAMAGE;
        } else if (solid) {
            actionName = ACTION_SOLID;
        } else if (damage) {
            actionName = ACTION_DAMAGE;
        } else {
            actionName = ACTION_Preplaced;
        }
        panel.addChild(new Label(mc, this).setText(actionName).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT));
        filterList.addChild(panel);
    }
}

14 View Complete Implementation : GuiRemoteStorage.java
Copyright MIT License
Author : McJtyMods
@Override
public void initGui() {
    super.initGui();
    long maxEnergyStored = tileEnreplacedy.getCapacity();
    energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(10, 7, 8, 54).setShowText(false);
    energyBar.setValue(GenericEnergyStorageTileEnreplacedy.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(tileEnreplacedy.isGlobal(i) ? 1 : 0);
        toplevel.addChild(global[i]);
    }
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
}

14 View Complete Implementation : GuiTeleportProbe.java
Copyright MIT License
Author : McJtyMods
private void populateList() {
    if (serverDestinationList == null) {
        return;
    }
    if (serverDestinationList.equals(destinationList)) {
        return;
    }
    destinationList = new ArrayList<>(serverDestinationList);
    list.removeChildren();
    for (TeleportDestinationClientInfo destination : destinationList) {
        BlockPos coordinate = destination.getCoordinate();
        int dim = destination.getDimension();
        Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout());
        panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setText(destination.getName()).setDesiredWidth(100));
        panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setText(BlockPosTools.toString(coordinate)).setDesiredWidth(75));
        panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setText("Id " + dim).setDesiredWidth(75));
        list.addChild(panel);
    }
}

14 View Complete Implementation : GuiProcessor.java
Copyright MIT License
Author : McJtyMods
@Override
public void initGui() {
    super.initGui();
    // --- Main window ---
    Panel toplevel = new Panel(mc, this).setLayout(new PositionalLayout()).setBackground(mainBackground);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    long maxEnergyStored = tileEnreplacedy.getCapacity();
    energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(122, 4, 70, 10)).setShowText(false).setHorizontal();
    energyBar.setValue(GenericEnergyStorageTileEnreplacedy.getCurrentRF());
    toplevel.addChild(energyBar);
    exclusive = new ToggleButton(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(122, 16, 40, 15)).setCheckMarker(true).setText("Excl.").setTooltips(TextFormatting.YELLOW + "Exclusive mode", "If pressed then programs on", "card X can only run on core X");
    exclusive.setPressed(tileEnreplacedy.isExclusive());
    exclusive.addButtonEvent(parent -> {
        tileEnreplacedy.setExclusive(exclusive.isPressed());
        sendServerCommand(RFToolsCtrlMessages.INSTANCE, ProcessorTileEnreplacedy.CMD_SETEXCLUSIVE, TypedMap.builder().put(PARAM_EXCLUSIVE, exclusive.isPressed()).build());
    });
    toplevel.addChild(exclusive);
    hudMode = new ChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(122 + 40 + 1, 16, 28, 15)).addChoices("Off", "Log", "Db", "Gfx").setChoiceTooltip("Off", "No overhead log").setChoiceTooltip("Log", "Show the normal log").setChoiceTooltip("Db", "Show a debug display").setChoiceTooltip("Gfx", "Graphics display");
    switch(tileEnreplacedy.getShowHud()) {
        case HUD_OFF:
            hudMode.setChoice("Off");
            break;
        case HUD_LOG:
            hudMode.setChoice("Log");
            break;
        case HUD_DB:
            hudMode.setChoice("Db");
            break;
        case HUD_GFX:
            hudMode.setChoice("Gfx");
            break;
    }
    hudMode.addChoiceEvent((parent, newChoice) -> {
        String choice = hudMode.getCurrentChoice();
        int m = HUD_OFF;
        if ("Off".equals(choice)) {
            m = HUD_OFF;
        } else if ("Log".equals(choice)) {
            m = HUD_LOG;
        } else if ("Db".equals(choice)) {
            m = HUD_DB;
        } else {
            m = HUD_GFX;
        }
        sendServerCommand(RFToolsCtrlMessages.INSTANCE, ProcessorTileEnreplacedy.CMD_SETHUDMODE, TypedMap.builder().put(PARAM_HUDMODE, m).build());
    });
    toplevel.addChild(hudMode);
    setupLogWindow(toplevel);
    for (int i = 0; i < ProcessorTileEnreplacedy.CARD_SLOTS; i++) {
        setupButtons[i] = new ToggleButton(mc, this).addButtonEvent(this::setupMode).setTooltips(TextFormatting.YELLOW + "Resource allocation", "Setup item and variable", "allocation for this card").setLayoutHint(new PositionalLayout.PositionalHint(11 + i * 18, 6, 15, 7)).setUserObject("allowed");
        toplevel.addChild(setupButtons[i]);
    }
    window = new Window(this, toplevel);
    // --- Side window ---
    Panel listPanel = setupVariableListPanel();
    Panel sidePanel = new Panel(mc, this).setLayout(new PositionalLayout()).setBackground(sideBackground).addChild(listPanel);
    sidePanel.setBounds(new Rectangle(guiLeft - SIDEWIDTH, guiTop, SIDEWIDTH, ySize));
    sideWindow = new Window(this, sidePanel);
}

13 View Complete Implementation : GuiItemFilter.java
Copyright MIT License
Author : McJtyMods
@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
    int[] inputMode = tileEnreplacedy.getInputMode();
    int[] outputMode = tileEnreplacedy.getOutputMode();
    for (EnumFacing direction : EnumFacing.VALUES) {
        final int side = direction.ordinal();
        for (int slot = 0; slot < ItemFilterTileEnreplacedy.BUFFER_SIZE; slot++) {
            ImageChoiceLabel choiceLabel = new ImageChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(25 + slot * 18, 4 + side * 13, 12, 12)).addChoice("0", "Disabled", iconGuiElements, 160, 0).addChoice("1", "Input", iconGuiElements, 96, 16).addChoice("2", "Output", iconGuiElements, 80, 16);
            bits[side * ItemFilterTileEnreplacedy.BUFFER_SIZE + slot] = choiceLabel;
            if ((inputMode[side] & (1 << slot)) != 0) {
                choiceLabel.setCurrentChoice(1);
            } else if ((outputMode[side] & (1 << slot)) != 0) {
                choiceLabel.setCurrentChoice(2);
            } else {
                choiceLabel.setCurrentChoice(0);
            }
            final int finalSlot = slot;
            choiceLabel.addChoiceEvent((parent, newChoice) -> changeMode(side, finalSlot));
            toplevel.addChild(choiceLabel);
        }
    }
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
}

13 View Complete Implementation : GuiLevelEmitter.java
Copyright MIT License
Author : McJtyMods
@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setBackground(iconLocation).setLayout(new PositionalLayout());
    mcjty.lib.gui.widgets.TextField amountField = new mcjty.lib.gui.widgets.TextField(mc, this).setTooltips("Set the amount of items in slot").setName("amount").setLayoutHint(60, 3, 80, 14);
    ChoiceLabel starredLabel = new ChoiceLabel(mc, this).setName("starred").addChoices(NOTSTARRED, STARRED).setChoiceTooltip(NOTSTARRED, "All inventories are considered").setChoiceTooltip(STARRED, "Only routable inventories are considered");
    starredLabel.setLayoutHint(60, 19, 80, 14);
    starredLabel.setChoice(tileEnreplacedy.isStarred() ? STARRED : NOTSTARRED);
    ChoiceLabel oreDictLabel = new ChoiceLabel(mc, this).setName("oredict").addChoices(OREDICT_IGNORE, OREDICT_USE).setChoiceTooltip(OREDICT_IGNORE, "Ingore ore dictionary").setChoiceTooltip(OREDICT_USE, "Use ore dictionary matching");
    oreDictLabel.setLayoutHint(60, 35, 80, 14);
    oreDictLabel.setChoice(tileEnreplacedy.isOreDict() ? OREDICT_USE : OREDICT_IGNORE);
    toplevel.addChild(new Label(mc, this).setText("Amount:").setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setLayoutHint(10, 3, 50, 14)).addChild(amountField).addChild(new Label(mc, this).setText("Routable:").setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setLayoutHint(10, 19, 50, 14)).addChild(starredLabel).addChild(new Label(mc, this).setText("Oredict:").setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setLayoutHint(10, 35, 50, 14)).addChild(oreDictLabel);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
    window.bind(RFToolsMessages.INSTANCE, "amount", tileEnreplacedy, LevelEmitterTileEnreplacedy.VALUE_AMOUNT.getName());
    window.bind(RFToolsMessages.INSTANCE, "starred", tileEnreplacedy, LevelEmitterTileEnreplacedy.VALUE_STARRED.getName());
    window.bind(RFToolsMessages.INSTANCE, "oredict", tileEnreplacedy, LevelEmitterTileEnreplacedy.VALUE_OREDICT.getName());
}

13 View Complete Implementation : GuiModularStorage.java
Copyright MIT License
Author : McJtyMods
private Pair<Panel, Integer> addItemToList(ItemStack stack, WidgetList itemList, Pair<Panel, Integer> currentPos, int numcolumns, int labelWidth, int spacing, int slot, boolean newgroup, String groupName) {
    Panel panel = currentPos.getKey();
    if (panel == null || currentPos.getValue() >= numcolumns || (newgroup && groupName != null)) {
        if (newgroup && groupName != null) {
            AbstractWidget<?> groupLabel = new Label(mc, this).setText(groupName).setColor(ModularStorageConfiguration.groupForeground.get()).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setFilledBackground(ModularStorageConfiguration.groupBackground.get()).setDesiredHeight(10).setDesiredWidth(231);
            itemList.addChild(new Panel(mc, this).setLayout(new HorizontalLayout().setHorizontalMargin(2).setVerticalMargin(0)).setDesiredHeight(10).addChild(groupLabel));
        }
        panel = new Panel(mc, this).setLayout(new HorizontalLayout().setSpacing(spacing)).setDesiredHeight(12).setUserObject(new Integer(-1)).setDesiredHeight(16);
        currentPos = MutablePair.of(panel, 0);
        itemList.addChild(panel);
    }
    BlockRender blockRender = new BlockRender(mc, this).setRenderItem(stack).setUserObject(new Integer(slot)).setOffsetX(-1).setOffsetY(-1);
    panel.addChild(blockRender);
    if (labelWidth > 0) {
        String displayName;
        if (labelWidth > 100) {
            displayName = typeModule.getLongLabel(stack);
        } else {
            displayName = typeModule.getShortLabel(stack);
        }
        AbstractWidget<?> label = new Label(mc, this).setText(displayName).setColor(StyleConfig.colorTextInListNormal).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setDesiredWidth(labelWidth).setUserObject(new Integer(-1));
        panel.addChild(label);
    }
    currentPos.setValue(currentPos.getValue() + 1);
    return currentPos;
}

13 View Complete Implementation : GuiTools.java
Copyright MIT License
Author : McJtyMods
public static void showMessage(Minecraft mc, Gui gui, WindowManager windowManager, int x, int y, String replacedle) {
    Panel ask = new Panel(mc, gui).setLayout(new VerticalLayout()).setFilledBackground(0xff666666, 0xffaaaaaa).setFilledRectThickness(1);
    ask.setBounds(new Rectangle(x, y, 200, 40));
    Window askWindow = windowManager.createModalWindow(ask);
    ask.addChild(new Label(mc, gui).setText(replacedle));
    Panel buttons = new Panel(mc, gui).setLayout(new HorizontalLayout()).setDesiredWidth(100).setDesiredHeight(18);
    buttons.addChild(new Button(mc, gui).setText("Cancel").addButtonEvent((parent -> {
        windowManager.closeWindow(askWindow);
    })));
    ask.addChild(buttons);
}

13 View Complete Implementation : GuiCraftingCard.java
Copyright MIT License
Author : McJtyMods
@Override
public void initGui() {
    super.initGui();
    Panel toplevel = new Panel(mc, this).setLayout(new PositionalLayout()).setBackground(iconLocation);
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    toplevel.addChild(new Label(mc, this).setText("Regular 3x3 crafting recipe").setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(10, 4, 160, 14)));
    toplevel.addChild(new Label(mc, this).setText("or more complicated recipes").setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setLayoutHint(new PositionalLayout.PositionalHint(10, 17, 160, 14)));
    toplevel.addChild(new Button(mc, this).setText("Update").setTooltips("Update the item in the output", "slot to the recipe in the", "3x3 grid").addButtonEvent(parent -> RFToolsCtrlMessages.INSTANCE.sendToServer(new PacketSendServerCommand(RFToolsControl.MODID, CommandHandler.CMD_TESTRECIPE, TypedMap.EMPTY))).setLayoutHint(new PositionalLayout.PositionalHint(110, 57, 60, 14)));
    ToggleButton toggle = new ToggleButton(mc, this).setCheckMarker(true).setText("NBT").setTooltips("Enable this if you want", "opcodes like 'get_ingredients'", "to strictly match on NBT").setLayoutHint(new PositionalLayout.PositionalHint(110, 74, 60, 14));
    ItemStack heldItem = mc.player.getHeldItem(EnumHand.MAIN_HAND);
    if (!heldItem.isEmpty()) {
        toggle.setPressed(CraftingCardItem.isStrictNBT(heldItem));
    }
    toggle.addButtonEvent(parent -> {
        RFToolsCtrlMessages.INSTANCE.sendToServer(new PacketUpdateNBreplacedemCard(TypedMap.builder().put(new Key<>("strictnbt", Type.BOOLEAN), toggle.isPressed()).build()));
    });
    toplevel.addChild(toggle);
    for (int y = 0; y < GRID_HEIGHT; y++) {
        for (int x = 0; x < GRID_WIDTH; x++) {
            int idx = y * GRID_WIDTH + x;
            createDummySlot(toplevel, idx, new PositionalLayout.PositionalHint(x * 18 + 10, y * 18 + 37, 18, 18), createSelectionEvent(idx));
        }
    }
    createDummySlot(toplevel, INPUT_SLOTS, new PositionalLayout.PositionalHint(10 + 8 * 18, 37, 18, 18), createSelectionEvent(INPUT_SLOTS));
    updateSlots();
    window = new Window(this, toplevel);
}

13 View Complete Implementation : ItemEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
    Label label = new Label(mc, gui).setText("Drop item:");
    constantPanel.addChild(label);
    blockRender = new BlockRender(mc, gui).setDesiredWidth(18 + 100).setDesiredHeight(18).setFilledRectThickness(1).setFilledBackground(0xff555555).setShowLabel(true);
    constantPanel.addChild(blockRender);
    blockRender.addSelectionEvent(new BlockRenderEvent() {

        @Override
        public void select(Widget widget) {
            ItemStack holding = Minecraft.getMinecraft().player.inventory.gereplacedemStack();
            if (holding.isEmpty()) {
                blockRender.setRenderItem(null);
            } else {
                ItemStack copy = holding.copy();
                copy.setCount(1);
                blockRender.setRenderItem(copy);
            }
            callback.valueChanged(readValue());
        }

        @Override
        public void doubleClick(Widget widget) {
        }
    });
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_ITEM);
}

13 View Complete Implementation : GuiController.java
Copyright MIT License
Author : McJtyMods
public static void showMessage(Minecraft mc, Gui gui, WindowManager windowManager, int x, int y, String replacedle, ButtonEvent okEvent) {
    Panel ask = new Panel(mc, gui).setLayout(new VerticalLayout()).setFilledBackground(0xff666666, 0xffaaaaaa).setFilledRectThickness(1);
    ask.setBounds(new Rectangle(x, y, 200, 40));
    Window askWindow = windowManager.createModalWindow(ask);
    ask.addChild(new Label(mc, gui).setText(replacedle));
    Panel buttons = new Panel(mc, gui).setLayout(new HorizontalLayout()).setDesiredWidth(100).setDesiredHeight(18);
    if (okEvent != null) {
        buttons.addChild(new Button(mc, gui).setText("Cancel").addButtonEvent((parent -> {
            windowManager.closeWindow(askWindow);
        })));
        buttons.addChild(new Button(mc, gui).setText("OK").addButtonEvent(parent -> {
            windowManager.closeWindow(askWindow);
            okEvent.buttonClicked(parent);
        }));
    } else {
        buttons.addChild(new Button(mc, gui).setText("OK").addButtonEvent((parent -> {
            windowManager.closeWindow(askWindow);
        })));
    }
    ask.addChild(buttons);
}

13 View Complete Implementation : GuiController.java
Copyright MIT License
Author : McJtyMods
private void refreshChannelEditor() {
    if (!listsReady()) {
        return;
    }
    if (editingChannel != -1 && showingChannel != editingChannel) {
        showingChannel = editingChannel;
        channelButtons[editingChannel].setPressed(true);
        copyConnector = null;
        channelEditPanel.removeChildren();
        if (channelButtons[editingChannel].isPressed()) {
            ChannelClientInfo info = fromServer_channels.get(editingChannel);
            if (info != null) {
                ChannelEditorPanel editor = new ChannelEditorPanel(channelEditPanel, mc, this, editingChannel);
                editor.label("Channel " + (editingChannel + 1)).shift(5).toggle(TAG_ENABLED, "Enable processing on this channel", info.isEnabled()).shift(5).text(TAG_NAME, "Channel name", info.getChannelName(), 65);
                info.getChannelSettings().createGui(editor);
                Button remove = new Button(mc, this).setText("x").setTextOffset(0, -1).setTooltips("Remove this channel").setLayoutHint(new PositionalLayout.PositionalHint(151, 1, 9, 10)).addButtonEvent(parent -> removeChannel());
                channelEditPanel.addChild(remove);
                editor.setState(info.getChannelSettings());
                Button copyChannel = new Button(mc, this).setText("C").setTooltips("Copy this channel to", "the clipboard").setLayoutHint(new PositionalLayout.PositionalHint(134, 19, 25, 14)).addButtonEvent(parent -> copyChannel());
                channelEditPanel.addChild(copyChannel);
                copyConnector = new Button(mc, this).setText("C").setTooltips("Copy this connector", "to the clipboard").setLayoutHint(new PositionalLayout.PositionalHint(114, 19, 25, 14)).addButtonEvent(parent -> copyConnector());
                channelEditPanel.addChild(copyConnector);
            } else {
                ChoiceLabel type = new ChoiceLabel(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(5, 3, 95, 14));
                for (IChannelType channelType : XNet.xNetApi.getChannels().values()) {
                    // Show names?
                    type.addChoices(channelType.getID());
                }
                Button create = new Button(mc, this).setText("Create").setLayoutHint(new PositionalLayout.PositionalHint(100, 3, 53, 14)).addButtonEvent(parent -> createChannel(type.getCurrentChoice()));
                Button paste = new Button(mc, this).setText("Paste").setTooltips("Create a new channel", "from the clipboard").setLayoutHint(new PositionalLayout.PositionalHint(100, 17, 53, 14)).addButtonEvent(parent -> pasteChannel());
                channelEditPanel.addChild(type).addChild(create).addChild(paste);
            }
        }
    } else if (showingChannel != -1 && editingChannel == -1) {
        showingChannel = -1;
        channelEditPanel.removeChildren();
    }
}

13 View Complete Implementation : GuiController.java
Copyright MIT License
Author : McJtyMods
private void refreshConnectorEditor() {
    if (!listsReady()) {
        return;
    }
    if (editingConnector != null && !editingConnector.equals(showingConnector)) {
        showingConnector = editingConnector;
        connectorEditPanel.removeChildren();
        ChannelClientInfo info = fromServer_channels.get(editingChannel);
        if (info != null) {
            ConnectorClientInfo clientInfo = findClientInfo(info, editingConnector);
            if (clientInfo != null) {
                EnumFacing side = clientInfo.getPos().getSide();
                SidedConsumer sidedConsumer = new SidedConsumer(clientInfo.getConsumerId(), side.getOpposite());
                ConnectorClientInfo connectorInfo = info.getConnectors().get(sidedConsumer);
                Button remove = new Button(mc, this).setText("x").setTextOffset(0, -1).setTooltips("Remove this connector").setLayoutHint(new PositionalLayout.PositionalHint(151, 1, 9, 10)).addButtonEvent(parent -> removeConnector(editingConnector));
                ConnectorEditorPanel editor = new ConnectorEditorPanel(connectorEditPanel, mc, this, editingChannel, editingConnector);
                connectorInfo.getConnectorSettings().createGui(editor);
                connectorEditPanel.addChild(remove);
                editor.setState(connectorInfo.getConnectorSettings());
            } else {
                Button create = new Button(mc, this).setText("Create").setLayoutHint(new PositionalLayout.PositionalHint(85, 20, 60, 14)).addButtonEvent(parent -> createConnector(editingConnector));
                connectorEditPanel.addChild(create);
                Button paste = new Button(mc, this).setText("Paste").setTooltips("Create a new connector", "from the clipboard").setLayoutHint(new PositionalLayout.PositionalHint(85, 40, 60, 14)).addButtonEvent(parent -> pasteConnector());
                connectorEditPanel.addChild(paste);
            }
        }
    } else if (showingConnector != null && editingConnector == null) {
        showingConnector = null;
        connectorEditPanel.removeChildren();
    }
}

12 View Complete Implementation : FluidEditor.java
Copyright MIT License
Author : McJtyMods
@Override
public void build(Minecraft mc, Gui gui, Panel panel, ParameterEditorCallback callback) {
    Panel constantPanel = new Panel(mc, gui).setLayout(new HorizontalLayout());
    Label label = new Label(mc, gui).setText("Drop bucket:");
    constantPanel.addChild(label);
    blockRender = new BlockRender(mc, gui).setDesiredWidth(18 + 100).setDesiredHeight(18).setFilledRectThickness(1).setFilledBackground(0xff555555).setShowLabel(true);
    constantPanel.addChild(blockRender);
    blockRender.addSelectionEvent(new BlockRenderEvent() {

        @Override
        public void select(Widget widget) {
            ItemStack holding = Minecraft.getMinecraft().player.inventory.gereplacedemStack();
            if (holding.isEmpty()) {
                blockRender.setRenderItem(null);
            } else {
                blockRender.setRenderItem(stackToFluid(holding));
            }
            callback.valueChanged(readValue());
        }

        @Override
        public void doubleClick(Widget widget) {
        }
    });
    createEditorPanel(mc, gui, panel, callback, constantPanel, ParameterType.PAR_FLUID);
}

11 View Complete Implementation : GuiScreen.java
Copyright MIT License
Author : McJtyMods
private void installModuleGui(int i, ItemStack slot, IModuleProvider moduleProvider, Clreplaced<? extends IClientScreenModule<?>> clientScreenModuleClreplaced) {
    buttons[i].setEnabled(true);
    toplevel.removeChild(modulePanels[i]);
    try {
        IClientScreenModule<?> clientScreenModule = clientScreenModuleClreplaced.newInstance();
        clientScreenModules[i] = clientScreenModule;
    } catch (InstantiationException | IllegalAccessException e) {
        throw new RuntimeException(e);
    }
    NBTTagCompound tagCompound = slot.getTagCompound();
    if (tagCompound == null) {
        tagCompound = new NBTTagCompound();
    }
    final NBTTagCompound finalTagCompound = tagCompound;
    ScreenModuleGuiBuilder guiBuilder = new ScreenModuleGuiBuilder(mc, this, tagCompound, () -> {
        slot.setTagCompound(finalTagCompound);
        tileEnreplacedy.setInventorySlotContents(i, slot);
        RFToolsMessages.INSTANCE.sendToServer(new PacketModuleUpdate(tileEnreplacedy.getPos(), i, finalTagCompound));
    });
    moduleProvider.createGui(guiBuilder);
    modulePanels[i] = guiBuilder.build();
    modulePanels[i].setLayoutHint(80, 8, 170, 114);
    modulePanels[i].setFilledRectThickness(-2).setFilledBackground(0xff8b8b8b);
    toplevel.addChild(modulePanels[i]);
    buttons[i].setText(moduleProvider.getName());
}

11 View Complete Implementation : GuiModularStorage.java
Copyright MIT License
Author : McJtyMods
@Override
public void initGui() {
    super.initGui();
    itemList = new WidgetList(mc, this).setName("items").setLayoutHint(new PositionalLayout.PositionalHint(5, 3, 235, ySize - 89)).setNoSelectionMode(true).setUserObject(new Integer(-1)).setLeftMargin(0).setRowheight(-1);
    Slider slider = new Slider(mc, this).setLayoutHint(new PositionalLayout.PositionalHint(241, 3, 11, ySize - 89)).setDesiredWidth(11).setVertical().setScrollableName("items");
    Panel modePanel = setupModePanel();
    cycleButton = new Button(mc, this).setName("cycle").setChannel("cycle").setText("C").setTooltips("Cycle to the next storage module").setLayoutHint(new PositionalLayout.PositionalHint(5, ySize - 23, 16, 16));
    Panel toplevel = new Panel(mc, this).setLayout(new PositionalLayout()).addChild(itemList).addChild(slider).addChild(modePanel).addChild(cycleButton);
    toplevel.setBackgrounds(iconLocationTop, iconLocation);
    toplevel.setBackgroundLayout(false, ySize - ModularStorageConfiguration.height1.get() + 2);
    if (tileEnreplacedy == null) {
        // We must hide three slots.
        ImageLabel hideLabel = new ImageLabel(mc, this);
        hideLabel.setLayoutHint(new PositionalLayout.PositionalHint(4, ySize - 26 - 3 * 18, 20, 55));
        hideLabel.setImage(guiElements, 32, 32);
        toplevel.addChild(hideLabel);
    }
    toplevel.setBounds(new Rectangle(guiLeft, guiTop, xSize, ySize));
    window = new Window(this, toplevel);
    window.event("cycle", (source, params) -> cycleStorage());
    window.event("compact", (source, params) -> compact());
    if (ModularStorageConfiguration.autofocusSearch.get()) {
        window.setTextFocus(filter);
    }
    CraftingGridProvider provider;
    BlockPos pos = null;
    if (tileEnreplacedy != null) {
        provider = tileEnreplacedy;
        pos = tileEnreplacedy.getPos();
    } else if (inventorySlots instanceof ModularStorageItemContainer) {
        ModularStorageItemContainer storageItemContainer = (ModularStorageItemContainer) inventorySlots;
        provider = storageItemContainer.getCraftingGridProvider();
    } else if (inventorySlots instanceof RemoteStorageItemContainer) {
        RemoteStorageItemContainer storageItemContainer = (RemoteStorageItemContainer) inventorySlots;
        provider = storageItemContainer.getCraftingGridProvider();
    } else {
        throw new RuntimeException("Should not happen!");
    }
    craftingGrid.initGui(modBase, network, mc, this, pos, provider, guiLeft, guiTop, xSize, ySize);
    sendServerCommand(RFTools.MODID, CommandHandler.CMD_REQUEST_GRID_SYNC, TypedMap.builder().put(CommandHandler.PARAM_POS, pos).build());
}

11 View Complete Implementation : GuiDevelopersDelight.java
Copyright MIT License
Author : McJtyMods
private void populateLists() {
    if (!listsDirty) {
        return;
    }
    if (teClreplacedes == null || blockClreplacedes == null || nbtData == null) {
        return;
    }
    listsDirty = false;
    blockClreplacedList.removeChildren();
    IBlockState state = Minecraft.getMinecraft().world.getBlockState(selected);
    Block block = state.getBlock();
    blockClreplacedList.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText("Loc Name: " + block.getLocalizedName()).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT));
    blockClreplacedList.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText("Unloc Name: " + block.getUnlocalizedName()).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT));
    blockClreplacedList.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText("Block Name: " + Block.REGISTRY.getNameForObject(block)).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT));
    for (String c : blockClreplacedes) {
        blockClreplacedList.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText("Clreplaced: " + c).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT));
    }
    teClreplacedList.removeChildren();
    for (String c : teClreplacedes) {
        teClreplacedList.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(c).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT));
    }
    nbtDataList.removeChildren();
    for (Map.Entry<String, DelightingInfoHelper.NBTDescription> me : nbtData.entrySet()) {
        Panel panel = new Panel(mc, this).setLayout(new HorizontalLayout());
        panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(me.getKey()).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setDesiredWidth(70));
        DelightingInfoHelper.NBTDescription value = me.getValue();
        panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(value.getType()).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT).setDesiredWidth(50));
        panel.addChild(new Label(mc, this).setColor(StyleConfig.colorTextInListNormal).setText(value.getValue()).setHorizontalAlignment(HorizontalAlignment.ALIGN_LEFT));
        nbtDataList.addChild(panel);
    }
    metaData.setText(String.valueOf(server_metadata));
}

11 View Complete Implementation : GuiProcessor.java
Copyright MIT License
Author : McJtyMods
private void openValueEditor(int varIdx) {
    if (fromServer_vars == null || varIdx > fromServer_vars.size()) {
        return;
    }
    if (fromServer_vars.get(varIdx) == null) {
        GuiTools.showMessage(mc, this, getWindowManager(), 50, 50, "Variable is not defined!");
        return;
    }
    Parameter parameter = fromServer_vars.get(varIdx);
    if (parameter == null) {
        GuiTools.showMessage(mc, this, getWindowManager(), 50, 50, "Variable is not defined!");
        return;
    }
    ParameterType type = parameter.getParameterType();
    ParameterEditor editor = ParameterEditors.getEditor(type);
    Panel editPanel;
    if (editor != null) {
        editPanel = new Panel(mc, this).setLayout(new PositionalLayout()).setFilledRectThickness(1);
        editor.build(mc, this, editPanel, o -> {
            NBTTagCompound tag = new NBTTagCompound();
            ParameterTypeTools.writeToNBT(tag, type, o);
            RFToolsCtrlMessages.INSTANCE.sendToServer(new PacketVariableToServer(tileEnreplacedy.getPos(), varIdx, tag));
        });
        editor.writeValue(parameter.getParameterValue());
        editor.constantOnly();
    } else {
        return;
    }
    Panel panel = new Panel(mc, this).setLayout(new VerticalLayout()).setFilledBackground(0xff666666, 0xffaaaaaa).setFilledRectThickness(1);
    panel.setBounds(new Rectangle(50, 50, 200, 60 + editor.getHeight()));
    Window modalWindow = getWindowManager().createModalWindow(panel);
    panel.addChild(new Label(mc, this).setText("Var " + varIdx + ":"));
    panel.addChild(editPanel);
    panel.addChild(new Button(mc, this).setChannel("close").setText("Close"));
    modalWindow.event("close", (source, params) -> getWindowManager().closeWindow(modalWindow));
}