Package com.kokakiwi.mclauncher.core.launcher

Examples of com.kokakiwi.mclauncher.core.launcher.ModsManager


    private LauncherApplet    applet;
   
    public Launcher(MCLauncher main)
    {
        this.main = main;
        mods = new ModsManager();
    }
View Full Code Here


        modsListPanel.setLayout(new BorderLayout(0, 0));
       
        actionPanel = new JPanel();
        panel.add(actionPanel, BorderLayout.SOUTH);
       
        final ModsManager mods = parent.getApi().getLauncher().getMods();
        model = new DefaultListModel<ModsManager.Mod>();
        for (ModsManager.Mod mod : mods.getMods())
        {
            model.addElement(mod);
        }
       
        modsList = new JList<ModsManager.Mod>(model);
        modsList.setAutoscrolls(true);
        modsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
       
        JScrollPane scrollPane = new JScrollPane(modsList);
        modsListPanel.add(scrollPane, BorderLayout.CENTER);
       
        JPanel actionsPanel = new JPanel();
        modsPanel.add(actionsPanel);
        actionsPanel.setLayout(new GridLayout(0, 1, 5, 5));
       
        JButton addModButton = new JButton("Add mod");
        addModButton.addActionListener(new ActionListener() {
           
            public void actionPerformed(ActionEvent e)
            {
                actionPanel.removeAll();
                fillAddMod(actionPanel);
               
                validate();
            }
        });
        actionsPanel.add(addModButton);
       
        JButton editModButton = new JButton("Edit mod");
        editModButton.addActionListener(new ActionListener() {
           
            public void actionPerformed(ActionEvent e)
            {
                actionPanel.removeAll();
                fillEditMod(actionPanel);
               
                validate();
            }
        });
        actionsPanel.add(editModButton);
       
        JButton removeModButton = new JButton("Remove mod");
        removeModButton.addActionListener(new ActionListener() {
           
            public void actionPerformed(ActionEvent e)
            {
                actionPanel.removeAll();
               
                if (modsList.getSelectedValue() != null)
                {
                    ModsManager.Mod selected = modsList.getSelectedValue();
                    model.removeElement(selected);
                    mods.getMods().remove(selected);
                }
               
                validate();
            }
        });
View Full Code Here

TOP

Related Classes of com.kokakiwi.mclauncher.core.launcher.ModsManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.